Form Fields Making Readonly

Form Fields Making Read only

Making all the form fields readonly, by getting the controltype of fields , which excluding Iframes and Webresorces and Subgrids

function ReadOnly(){ 
 var controls = Xrm.Page.ui.controls.get();
 for (var i in controls)
 {
 var ControlType = controls[i].getControlType();
 if(ControlType != "iframe" && ControlType != "webresource" && ControlType !="subgrid")
 {
 controls[i].setDisabled(true);
 }
}

2 thoughts on “Form Fields Making Readonly

Leave a comment