Make form read only or locked using JavaScript in D365 CE [CRM]

function disableForm(executionContext) {
 debugger;
   var formContext = executionContext.getFormContext();
         var formControls = formContext.ui.controls;

   formControls.forEach(control => {
            if (control.getName() != "" && control.getName() != null) {
                control.setDisabled(true);
            }
        });
}

 
 

Leave Comment

Your email address will not be published. Required fields are marked *