13 Mart 2019 Çarşamba

Lock all fields on a form using Javascript- Microsoft Dynamics CRM

Hi,

The below code takes the control of the form directly rather then of each field and locks all of them.

 function disableFormFields()

{
      Xrm.Page.ui.controls.forEach(function (control, index) {
           var controlType = control.getControlType();
           if (controlType != “iframe” && controlType != “webresource” && controlType != “subgrid”)

           {
               control.setDisabled(true);
           }
       });
}