Create Business Rules
Business Rules were the coolest addition to the family of Dynamics 365 way back when it was known as CRM 2013 Online. They helped the developers in quickly applying some of the regularly used functionality like ‘Show/ Hide fields’, ‘Set field values, and more. So, this helped us to not write any JavaScript code for these functionalities.
Let us read about Business rules today. They help us in achieving the following functionalities/actions based on conditions:

- Lock/Unlock
- Show error messages
- Set field values
- Set Default value
- Set Business required
- Set Visibility
- Business recommendation
I am creating a business rule to Lock/Unlock fields of Lead entity. I want to lock City field if Name contains either ‘test’ or ‘demo’.

Add condition & set properties. Provide a Display Name that defines what this is about. Add Rules as per field you need.

Click on New to add the second rule and define Rule Logic (AND/ OR). Based on rules and logic, the condition expression will be updated. Click Apply to select this condition.
Add the action next (drag & drop) lock/unlock tile and similarly update its properties.

On the canvas designer, the overall text-view of business rule will look like below

Click on save. For a quick validation, click on Validate 
No errors will lead to Validation successful message
Most important of all Scope will define the trigger areas. The values are Entity (sets to All forms & server), All Forms, Specific Forms
Save & Activate the business rule and you are set!
Note –
- To modify the existing activated business rule, you must deactivate it first
- The business rule will be triggered first and then OnLoad JavaScript will be triggered
Read in detail in MS docs here
Keep reading, keep enjoying, keep exploring!
This was originally posted here.

Like
Report
*This post is locked for comments