Skip to content
Charles Llamas

How to disable all fields in a form by JavaScript Microsoft Dynamics CRM/365

1 min read

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

Related posts

Comments

No comments yet

No comments yet. Yours would be the first.

Leave a comment

Never published. Only used if I need to reply to you.

← All posts