The Microsoft Dynamics CRM 2013 release is a few short months away, and it will come with some great new features. In this blog we’ll discuss one of these new features—portable business logic. Then we’ll show how you can use it to create rules that hide and show fields on a form.
Portable business logic allows you to define business rules for each record type. You can use it to do any of the following:
- Show a message to the user
- Change a field value
- Set a field as business required/not business required
- Show or hide a field
- Lock or unlock a field
You can set all of these actions to occur based on conditions you set in the business rule. Conditions can be based on one of the following:
- If a field contains data or doesn’t contain data
- If a field contains a certain value or doesn’t contain a certain value
- If a field equals or does not equal another field value
Let’s take a look at an example of how this works. In this scenario, we want two custom fields—Role with Vendor and Priority—to show if a Contact is of Relationship Type Vendor.
We already have the two custom fields added to the form with their visibility disabled. Now we just need to setup the new Business Rule. Use the following steps create a new Business Rule for the Contact:
- Go to Settings > Customizations > Customize the System and navigate to contact entity.
- Under Business Rules, click New. CRM will pop up a window.
- Name the business rule. We will call it ‘Relationship Type = Vendor’
- To add a condition, click the plus sign under Condition. Here we enter the condition translates to “Relationship Type equals value Vendor“.
- Click the Check icon to save the condition.
- To add an action, click the plus sign near Action and choose Set Visibility. In this case, we need two actions: Field: Priority–Status Show Field; and Field: Role with Vendor—Status Show Field.
- To save the action, click the Check icon.
- Once complete, Save the new business rule and don’t forget to Activate. Also, make sure to Publish the changes.
NOTE: Keep in mind you may need to create inverse Business Rules to hide the fields if a different value is selected. In this case, you may want to make sure the ‘Role with Vendor’ and ‘Priority’ fields stay hidden if a different ‘Relationship Type’ is selected. Here would be the appropriate business rule:
There you go! Showing and hiding fields is now much simpler to implement using the new business rules.
If this was helpful, you can also check out our other blogs and resources for Microsoft Dynamics CRM 2013.