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.
Pingback: Make All Fields ReadOnly in CRM Form | Microsoft Dynamic xRM
Reblogged this on Parthiban and commented:
will this work for 2016 ?
is above mentioned reference are default available in crm 2015 and above ??
LikeLike
Hi Parthban,
It is for 2013 to 2016 version.
Regards,
LikeLike
Thank you was very helpful for me.
gideon
LikeLike
hi what to do if i want to make all fields readonly except for one field?
LikeLike
You can write the javascript function to do it, you can get all fields in a form, then proceed the logic
LikeLike
Just design the method for checking the field and call hide or show.
LikeLike