Skip to main content

Notifications

How to disable all fields in a Dynamics 365 CRM Form?

Background:

Disabling all fields of the Dynamics 365 form may be necessary for certain scenarios, such as when performing data migration or making bulk updates to records.

This prevents users from inadvertently making changes to the data during the process, ensuring that the migrated or updated data is accurate and complete.

Additionally, disabling fields can temporarily prevent users from entering or modifying data until certain conditions are met or specific actions are taken.

Test scenario:

For example,  if a user has submitted a request for approval and it’s currently in the “Pending Approval” status, then they are not allowed to modify any data in the Form.

Test Environment:

Product: Dynamics 365 CRM online

Entity: Account

Event: on load

Logic: If [Status Reason] is [Pending Approval] then disable all fields

Step 1: Write JavaScript

pastedimage1682415973333v1.png

Step 2: Bind On Load Event

4555.pastedimage1682414505607v1.png

3007.pastedimage1682414628202v2.png

Then test it.

pastedimage1682415642757v4.png

Sub-Grid can't be disabled

However, the sub-grid isn't disabled.

pastedimage1682426751597v2.png

About how to disable a sub-grid, please refer to the link below.

How to disable a sub-grid in Form

Not Recommended Solution

Another solution is that we can also achieve the same functionality through Business Rule.

But we have to manually select all fields and when Add/Remove fields from the Form, we have to modify the Business Rule accordingly.

The scalability is not good, so this is not a good approach.

pastedimage1682426328725v1.png

The End

Comments

*This post is locked for comments