Business Rules in Dynamics CRM offer a quick and easy way to create functionality out-of-the-box, and in many instances, eliminates the need for expensive custom coding and development that would be required in previous versions of Dynamics. Though simple to create and manage, there are some scenarios when a business rule isn't working as it should that can drive a System Administrator insane! In today's blog, we broke down a few quick tips to get your business rules working as they should and help you stop pounding your head against the wall. Let's take a look!
Problem: Field A's value hides field B, but when A changes or is cleared, field B doesn't come back.
In most cases, the answer lies in the Else condition of the business rule. You will need to create an Else condition to make sure that if the "If…Then" rule doesn't apply, the hidden field will update accordingly. Here is an example:
This same logic can be applied to many other examples as well, such as clearing field B's value on the change of field A:
Problem: The Business Rule isn't doing anything, even though it's simple and clean.
Next, check to see if the field name of the fields being used are duplicates with another field on the entity. Business Rules will not run properly if the name of the field is duplicated elsewhere on the form. Not to be confused with the display name or the schema name, changing the duplicated field's name (adding a "1", "new", "A", etc.) will do the trick. Now, activate your business rule after making a change to the field name, and try again.
If that doesn't work, check to make sure you have the correct field. If there are two "Status" fields, one being an option-set, the other being a text field, double-check to make sure you used the correct one.
Lastly, check to make sure you don't have competing Business Rules. This may happen if the same field is used in different rules with generally the same rule behavior. If you need to hide field B with two different values in field A, make sure to create a single Business Rule incorporating both values – there is no need for two Business Rules. Business Rules fire in order from most recently activated to last activated, so keep this in mind. If you need to stagger the rules, you will need to deactivate and re-activate in the reverse order you need them to fire.
Problem: Why can't I find a field I need when creating the Business Rule?
Check to make sure the field you would like to use isn't a calculated field. Calculated fields cannot be used in a Business Rule, nor can they be used to trigger workflows.
These are just a handful of simple tips. The more complex the Business Rule, the longer troubleshooting will take. With these basic principles, however, you should be able to find the root cause of what's wrong with your Business Rules. Keep coming back to https://powerobjects.com for all of your Dynamics CRM needs!