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
