Configuring Business Rules within Microsoft Dynamics 365 (CRM)
Change is the only constant in a business environment. Various factors influence the change such as market dynamics, competition, government regulations, and partnerships. Change can be as significant reinventing the business model or as minor as changing a deadline.
It’s inevitable, so to stay relevant within an industry, companies need to be agile and flexible. The flexibility to tailor and adjust the business processes is key. Having access to technology that can offer this flexibility can be a game-changer to compete within the marketplace.
The Microsoft Dynamics 365 platform does this for business users to adapt their methods and make relevant adjustments by using an intuitive user interface without involving IT or external vendors. The Microsoft Dynamics 365 platform not only empowers business stakeholders to be in control but also enables them to be more responsive to their customers’ needs with cost effectiveness. The days are long gone when a simple process change would cost thousands of dollars with weeks of implementation.
In this article, we will explore the capabilities and application of “Business Rules” within Microsoft Dynamics 365. We have chosen a very simple example to demonstrate how easy it is to configure it within the Microsoft Dynamics 365 platform. This specific example is related to productivity and user experience, allowing users to see contextual information to perform the task at hand.
What are Business Rules?
Business Rules Capabilities
As mentioned above, Business Rules are used to perform actions on the client-side only. The actions that can be performed are listed below:
- Show error message: This action will display an error message if the specified condition is not met. For example, if the data entered in a field does not meet certain validation criteria then Business Rules can be configured to display an error message to the user and restrict them from saving invalid data in CRM.
- Set field value: This action can be consumed to set a field’s value based on the condition. International business could use the country field value to automatically fill the country’s dialing code.
- Set business required: By choosing this action, the mandatory field can be marked as non-mandatory and vice versa.
Set visibility: This action can hide and show fields on the entity forms. It enables the power users or customizers to change the visibility of the fields dynamically based on the specified condition.
- Lock or unlock field: This action can be consumed to lock or unlock (enable or disable) fields dynamically. Unlocked or Enabled fields are editable and Locked or Disabled fields are read-only.
Business Rules Scenario
I’ve decided to add a scenario to illustrate what you could do with the business rules. Consider a business scenario where there is a requirement to hide/show “Shipping Method” and “Freight Terms” fields based on the “Industry” the Account belongs to.
The requirement is to
- Hide Shipping Method and Freight Terms if the Industry is set to “Consulting”
- Show Shipping Method and Freight Terms if the Industry is not set to “Consulting”
Microsoft Dynamics 365 (CRM) has the following three fields on the Account entity form.
- Shipping Method
- Freight Terms
Step-by-step guide to creating Business Rules
Step 1: Click on “Settings”
Step 2: Click “Customization” -> “Customize the System”
Step 3: Click Account -> Business Rules -> New (to create a new Business Rule, as shown in the figure below)
Step 4: Specify the name for the new Business Rule
Step 5: Create a new condition – if Industry is set to “Consulting”
Step 6: Now click plus sign button to add Action
Step 7: Select the action “Set Visibility”
Step 8: Set the Actions to hide “Address 1: Shipping Method” and “Address 1: Freight Terms”
Step 9: Save the Business Rule
Step 10: Activate the Business Rule
Step 11: Create a new Business Rule to show fields
Step 12: Create a condition as shown below – if industry is NOT EQUAL to Consulting
Step 13: Select “Set visibility” action
Step 14: Create actions as shown below
Step 15: Click “Save” to save the newly created Business Rule
Step 16: Activate the Business Rule
Step 17: Publish All Customizations
Step 18: Verify the newly configured Business Rule