*Example Script
Purpose : To disable all field in the section.
function DisableSectionAttributes(SectionName) {
function setFldDisabled(ctrl) {
ctrl.setDisabled(true);
}
function setFldEnabled(ctrl) {
ctrl.setDisabled(false);
}
var ctrlName = Xrm.Page.ui.controls.get();
for (var i in ctrlName) {
var ctrl = ctrlName[i];
var ctrlSection = ctrl.getParent().getName();
if (ctrlSection == SectionName) {
setFldDisabled(ctrl);
}
}
}
Using section name to disable the field.
No comments:
Post a Comment