Dynamics 365 Lock and Unlock Fields Using Business Rules

Dynamics 365 Lock and Unlock Fields Using Business Rules

Business Rules in Dynamics 365 provide a powerful low-code approach for implementing business logic without writing JavaScript. One common requirement is to lock or unlock fields based on specific conditions, ensuring users can only edit information when appropriate.

Using Business Rules, administrators can dynamically control field editability, improve data quality, and enforce organizational processes across model-driven applications.

Why Lock or Unlock Fields?

Business Scenario

Suppose an Approval Status field contains the following values:

Once the status becomes Approved, users should no longer be allowed to modify specific fields.

Create a Business Rule

  1. Open the target table in Dataverse.
  2. Select Business Rules.
  3. Click New Business Rule.
  4. Add a Condition component.
  5. Select the Approval Status field.
  6. Configure the condition.

Configure the Condition

If

Approval Status

Equals

Approved

Lock the Field

Drag a Set Field Requirement or Lock/Unlock action onto the True branch.

Action:

Lock Field

Target Field:

Project Budget

Unlock the Field

On the False branch, configure the field to remain editable.

Action:

Unlock Field

Target Field:

Project Budget
Important: Business Rules run on forms and help enforce client-side business logic without requiring custom JavaScript development.

Activate the Business Rule

  1. Validate the Business Rule.
  2. Save the rule.
  3. Activate the rule.
  4. Publish customizations.
  5. Test the form behavior.

Common Use Cases

Benefits of Business Rules

Key Takeaways