PowerObjects has numerous blogs and resources already published on various tips and tricks on this new release of Dynamics CRM. Today's blog will focus on business rules, a new feature to Microsoft Dynamics CRM 2013 that provides a great way to achieve the most common and simple validations without coding skills.
Here are a few of the most common validations and business rules that can be implemented in CRM 2013:
- Make a field required when the value in another field is changed
- Set the value of a field based on various criteria
- Calculate the value in a field based on the value(s) of other field(s)
- Show an error message when an invalid value is entered
- Show/hide or enable/disable a field depending on the value entered in another field
- Set "Business Required"
Let's take an example and create a rule on the contact form to make a "Spouse/Partner Name" field required when the field "Marital Status" = Married.
- Navigate to Business Rules area in CRM 2013. To do this, go to Solutions, choose the desired entity, then select Business Rules. You can also get to it in the form editor by clicking Business Rules in the ribbon.
- Click New Business Rule.
- Set up the new rule as shown below and click Save.
- Click Activate to make it available to everybody.
- Navigate to the contact form and verify that when Marital Status does not equal Married, the Spouse/Partner Name field is unavailable.If the status says Married on the other hand, you'll now see a field that allows you to enter the name of a spouse or partner.
Note a few facets to remember when working with business rules:
- You can use business rules on CRM forms (Main and Quick Create) for both the web application and CRM for tablets
- Business rules are applicable to out-of-the-box entities that are customizable as well as custom entities.
- You "activate" the rule after creating it.
- You can duplicate a rule using Save As and reuse it for other validations.
- Business rules can be packaged in a solution.
- If you have multiple forms, you can specify the rule to work on only one form or all forms.
- They are limited to single entity, i.e., you can't build validations for parent-child entities.
- They have limited capability for conditional logic (if-else scenarios) with multiple branches.
If this blog was helpful, don't forget to check out our other blogs and resources for Microsoft Dynamics CRM 2013.