web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / DynamicsDevPro / MSCRM - Disable all fields ...

MSCRM - Disable all fields using javascript - Make fields read only

ram r Profile Picture ram r
Hello all,

Below is a simple JavaScript  function that can disable all fields in a form by iterating through controls.

The below code is mobile(MoCA) compatible, so feel free to use it even on mobile based JavaScript development.


    function disableAllFields() {
Xrm.Page.ui.controls.forEach(function (control, i) {
if (control && control.getDisabled && !control.getDisabled()) {
control.setDisabled(true);
}
});
}






This was originally posted here.

Comments

*This post is locked for comments