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);
}
});
}
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);
}
});
}