The pain of missing “Else If” condition in Business Rules in CRM 2013.

Let us take a simple example

There is a field say “Test Field” and 2 option set fields.

OptionSet1 è A1, A2, A3, A4

OptionSet2èB1, B2, B3, B4

Now the logic that we have to implement is

Show “Test Field” when

OptionSet1 = A1 and OptionSet2= B1

Or

OptionSet1 = A2 and OptionSet2= B2

Else

Field should be hidden

Logic in JavaScript

If (optionset1 == A1 && optionset2== B1)

Show field “Test Field”

Else if (optionset1 == A2 && optionset2== B2)

Show field “Test Field”

Else

Hide field “Test Field”

Logic in Business Rule

To implement the same in business we need write 6 business rules.

  1. If OptionSet1 = A1 and OptionSet2= B1 è Show “Test Field”
  2. If OptionSet1 = A2 and OptionSet2= B2 è Show “Test Field”
  3. If OptionSet1 != A1, A2 è Hide “Test Field”
  4. If OptionSet1 2= B1, B2 è Hide “Test Field”
  5. If OptionSet1 = A1 and OptionSet2= B2 è Show “Test Field”
  6. If OptionSet1 = A2 and OptionSet2= B1 è Show “Test Field”

Well the good news is that we now have “Else If” condition in CRM 2015.

https://nishantrana.me/2014/10/04/business-rules-in-crm-2015/

 


Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

1 thought on “The pain of missing “Else If” condition in Business Rules in CRM 2013.”

Share your thoughts

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