A Business Rule is a no – code or code-free way to apply rules to a form in Dynamics. You can use a Business Rule to set field values, clear field values, set field requirement levels, show or hide fields, enable or disable fields, validate data and show error messages, or create business recommendations based on business intelligence.
There are three options for Business Rule Scope:
- A specific form
- All forms
The business rule UI has two major templates which are “Components” and “Properties”. The properties are the configuration content of the main component.
The Components contain the query, actions and logic which a business rule can achieved.
Below are the details of all Components present in the business rules.
1. Condition – This component is used as an If – Else statement. Here we can validate several conditions like checking the value of the desired fields such as shown in below image where we are checking for the condition when field Account Name equals “Testing”.
2. Recommendation – Recommendations allow you to provide a recommendation to users on how to fill out a field. You can set certain criteria around a field and if a user meets those conditions a recommendation icon will appear. What happens is, when a user meets the conditions you set, a little icon appears on the form next to that field showing the recommendation and a user can apply or disregard it. When a user clicks the icon, another pop up appears with a recommendation. If you press the apply button it will fulfil the action you created and set the value of the field.
3. Lock / Unlock – Using this component we can lock and unlock any field on the form for any specific condition.
4. Error Message : Many times we have requirement to display a error message to the user to avoid him by entering faulty data. This requirement can be easily handled by Error Messages. An error message can be shown to the user on specific business conditions using this component.
5. Set Value – This component can be used to set a static or dynamic value in a field based on the condition. In this case, on the specified condition the value in field Account Name will be copied from field Account Number.
This component can also clear out the value of any field depending on the condition.
6. Set Default Value – We can set any default value in any field using this component.
7. Set Business Required – This component allows us to dynamically change any field to business required or mandatory based on the user condition.
8. Set Visibility – We can dynamically make a field visible and invisible using this business rule component.
For more information click on the link.