Skip to content

Make field read only using JavaScript in D365 CE

In this blog, we will learn how to make a column(field) read-only using JavaScript in D365 CE(CRM).

Syntax:

formContext.getControl(columnName).setDisabled(bool);

PARAMETER:

Code:

var formCustomizations = {
    disableControl: function (executionContext) {
        let formContext = executionContext.getFormContext();
        formContext.getControl("avt_date").setDisabled(true);
        formContext.getControl("avt_customer").setDisabled(true);

    }
}

Result

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments