How to disable all fields in a form by JavaScript Microsoft Dynamics CRM/365
1 min read
Charles Llamas
The below code disable all fields in a form:
function disableFormFields(formContext) { formContext.ui.controls.forEach(function (control, index) { var controlType = control.getControlType(); if (controlType != "webresource" && controlType != "subgrid" && controlType != "iframe") { control.setDisabled(true); } }); }