Is there a way to tell if the section is a header in CRM Form?
We're on Microsoft Dynamics CRM 2016 and I have a requirement to disable all fields on the Contact form when a certain condition is met. I'm using the code below and so far the code is working.
var attributes = Xrm.Page.data.entity.attributes.get();
for (var i in attributes) {
var myattribute = Xrm.Page.data.entity.attributes.get(attributes[i].getName());
var myname = myattribute.getName();
if (Xrm.Page.getControl(myname) != null) {
//alert(myname);
Xrm.Page.getControl(myname).setDisabled(true);
}
}
However the reason I ask, special for header fields, you need to put header_
before the field name in order to get to the header fields. For example header_name
. Since our CRM Manager likes to put different fields on the header, it'd be nice to automatically disable the header fields instead of manually change it.
Is there a way to tell if the section is a header in CRM Form?