Recently I had been asked by an Interviewer how can we set execution order for business rule in CRM. This actually made me to do some research over to get the right answer.
As such we don’t have any OOB ways defined to set the execution order.
So here is my Scenario suppose I have 2 Business rules for below logic:
- First Business rule
- If field A is greater than field 10 then set field B to 50.
- Second Business rule
- If field A is greater than field 70 then set field B to 90.
So suppose I enter 80 in A. Then what does the field B display ?
Obvious answer that comes in mind is the one which executes last will be displayed.
So CRM works in FIFO here i.e. First In First Out with respect to the order in which Activation of Business rule took place.
So suppose in the above scenario I want BR 2 to execute first and then BR1 then I have to first deactivate the BR1 and reactivate it, so that CRM internally executes BR1 after BR2.
However its tricky to manage it in real life scenario where we need to set the execution order of Business rules. So what you can do is deactivate all the Business rules for an entity and then based on which you need to execute first,second and third and so on you reactivate it in the same order.
Hope this info adds to you CRM knowledge.
