function
setFormAsReadOnly() {
// define the logic here
disableFormFields(true);
}
function doesControlHaveAttribute(control) {
var controlType = control.getControlType();
return controlType != "iframe" && controlType != "webresource" && controlType != "subgrid";
}
function disableFormFields(onOff) {
Xrm.Page.ui.controls.forEach(function(control, index) {
if (doesControlHaveAttribute(control)) {
control.setDisabled(onOff);
}
});
}
// define the logic here
disableFormFields(true);
}
function doesControlHaveAttribute(control) {
var controlType = control.getControlType();
return controlType != "iframe" && controlType != "webresource" && controlType != "subgrid";
}
function disableFormFields(onOff) {
Xrm.Page.ui.controls.forEach(function(control, index) {
if (doesControlHaveAttribute(control)) {
control.setDisabled(onOff);
}
});
}
No comments:
Post a Comment