1. 程式人生 > >Dynamics CRM JavaScript 表單禁用

Dynamics CRM JavaScript 表單禁用

function DisableForm() {
    var controls = Xrm.Page.ui.controls.get();
    for (var i in controls) {
        var control = controls[i];
        if (control.getControlType() != "iframe" && control.getControlType() != "webresource"
            && control.getControlType() != "subgrid" && control.getDisabled() == false) {
            control.setDisabled(true);
        }
    }
}