在CRM 2015中禁用表单上的所有字段

abd*_*roc 1 javascript c# crm

嗨,我希望在使用插件或Jscript保存时禁用CRM 2015中的所有字段

Ali*_*deh 13

Xrm.Page.data.entity.attributes.forEach(function (attribute, index) {    
    var control = Xrm.Page.getControl(attribute.getName());
    if (control) {
        control.setDisabled(true)
    }
});
Run Code Online (Sandbox Code Playgroud)