Disabling form in CRM 2011
Hi,
Here is the Jscript code to disable the CRM Form (i.e., Fields on the form)
function doesControlHaveAttribute(control){
var controlType = control.getControlType();
return controlType != “iframe” && controlType != “webresource” && controlType != “subgrid”;
}
function disableFormFields(truefalse){
Xrm.Page.ui.controls.forEach(function(control, index) {
if (doesControlHaveAttribute(control)){
control.setDisabled(truefalse);
}
});
}
How do I call this?
- To disable Form – disableFormFields(true)
- To Enable Form – disableFormFields(false)
Hope it Helps 🙂
Categories: CRM 2011, JScript
CRM 2011, CRM form, Disable CRM Form, Disable fields, JScript, rajeev, Read only
Comments (0)
Trackbacks (0)
Leave a comment
Trackback