Dynamics CRM 2015/2016 (Online & On-premises) Business Rules has been improved with the following features:
- Enriched business logic with- If..Else If..Else logic support
- Ability to combine expressions using And/Or
- Support for setting default values on the record.
- Business Rules can now be executed on the server side.
If Business Rule is created with scope as “Entity” then the business rules will execute server side. This means that business rule also can be executed when you do updates to a record by Workflows or Plugins.
Now I will show you a quick sample for showing Business Process Error by using business rules and workflow:
First we will be needed to add a new field on the entity, in this sample I have created a new tow options field which is called Show Message with default value "No":
Then I have created a business rule for checking the value of the field Show Message with scope as "Entity", If the field value is "Yes", then show the error message "The Amount Is less than 0!" against field Show Message :
Then create a real-time workflow for checking the value of any field, in this sample I created real-time workflow to check if the Amount is less than 0.
Now I will show you a quick sample for showing Business Process Error by using business rules and workflow:
First we will be needed to add a new field on the entity, in this sample I have created a new tow options field which is called Show Message with default value "No":
Then I have created a business rule for checking the value of the field Show Message with scope as "Entity", If the field value is "Yes", then show the error message "The Amount Is less than 0!" against field Show Message :
Then I added two steps, one for checking the amount of Amount field if less than 0, If Yes then the other step is to set Show Message field to "Yes"