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.
- If OptionSet1 = A1 and OptionSet2= B1 è Show “Test Field”
- If OptionSet1 = A2 and OptionSet2= B2 è Show “Test Field”
- If OptionSet1 != A1, A2 è Hide “Test Field”
- If OptionSet1 2= B1, B2 è Hide “Test Field”
- If OptionSet1 = A1 and OptionSet2= B2 è Show “Test Field”
- 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/