New Conditional Statements Dynamics CRM 2015 Business Rules

Posted: September 26, 2014 in Dynamics CRM 2015

Business Rules were introduced in CRM 2013, which allowed customizers to create simple conditions to manipulate the form without needing to write any JavaScript. The only limitation of this was that to create If-Then-Else style conditions we had to create multiple business rules to accommodate each possible scenario.

Dynamics CRM 2015 now introduces the ability to add additional conditions into a single business rule, allowing us to maintain all the logic for a single rule in one place, rather than across several business rules.

You can see we now have a button at the bottom ‘Add Else’. If we click this a new CONDITION/ACTION block will be added.

We can leave the CONDITION blank, and this will act as an ELSE, meaning if the first condition is not met, this action will fire no matter what. Otherwise if we specify a condition, this will become an ELSE IF, and we will have the option to add an additional ELSE below this.

We can repeat this as many times as we need to, creating as many ELSE IF’s as is required for this rule. I’ve added a few more conditions for if the Rating is ‘Cold’ to set Probability to 20, and finally an ‘ELSE’ which sets it to 0 if there is no Rating set for some reason.

Once we’re done we can activate the rule and test it out.

When creating a new Opportunity, straight away we can see the Probability is set to 60 since the Rating is Warm by default.

If we change the Rating to Hot or Cold the Probability will be updated based on our rules.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s