Make All Fields ReadOnly in CRM Form

Standard

Some case you want to set read only for all field in the forms. It will take time to set field by field. This is small tip for marking all field as read only in MS CRM form.

/// <reference path=”rbei_PACrm.Sdk.js” />

/// <reference path=”../PACRM2011/XrmPageTemplate.js” />

function MarkAllFieldReadOnly() {

Xrm.Page.ui.controls.forEach(function (control, index) {

try{

control.setDisabled(true);

}

catch (e)

{

}

});

}

 

Hope it will be useful for someone.

 

7 thoughts on “Make All Fields ReadOnly in CRM Form

  1. Pingback: Make All Fields ReadOnly in CRM Form | Microsoft Dynamic xRM

Leave a comment