Disabling all Fields on a Form in CRM 2015 [duplic

2019-02-20 14:35发布

问题:

This question already has an answer here:

  • setDisable for all fields of a Section in a Crm Form 4 answers

hi I want Disable all fields on a frorm in CRM 2015 on save using plugin or Jscript

回答1:

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