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

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

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