Mitch Milam's Dynamics CRM Discussions
Knowledge found and lost while working with Microsoft Dynamics CRM
-
Disabling all fields within a Section
Last week I encountered a need to disable all of the fields within a Section on a CRM Form. While you can set the properties individually, that is a waste of effort and a maintenance nightmare.
After a bit of digging, I found the following post on one of the CRM newsgroups by Kyaw Kyaw Tun, from http://www.pulsesync.com:
var section = crmForm.all.new_attribute_c.parentElement.parentElement.parentElement; for (i = 0; i < section.all.length; i++) { section.all[i].Disabled = true; }
You replace new_attribute with the name of an attribute that resides inside the section you wish to disable.
Note: That _c is not a mistake, that needs to be part of the attribute name. For instance, to hide the section containing accountnumber, you would use accountnumber_c.
Though the magic of the JavaScript Document Object Model ( DOM ), we’ll get a list of all of the fields and set their Disabled property to true.
Customization, Dynamics CRM 935 views




