Tips for working with Business Rules in Dynamics CRM 2015 Online

By | July 29, 2015

Introduction

Microsoft Dynamics CRM introduced Business Rules in CRM 2013 which provides custom business logic. You can read more about how to use Business Rules from one of our earlier blogs found here

In this blog we are going to show new abilities added in Business Rules for Dynamics CRM Update 1 as well as tips while working with Business Rules in CRM.

In Microsoft Dynamics CRM Online Update 1 a new ability is added in Business Rules to clear the field value. This functionality was not present in previous versions.

Example

Let us see how we can use Clear field option of Business rules, step by step using a simple example:

Consider an example where we want to use Business rule such that if the Credit Hold field in Accounts Entity is set to No then Clear value of Credit Limit field.

To accomplish this,

We will first create a new Business rule on Accounts entity and name it as “Clear Credit Limit”.

Then we will add the if condition as below:

business_rule

For Action we will select “set field value” option

business_rule1

In the type section we get Clear Option which clears the value of specified field when “if” condition is true.

business_rule2

Note: The Clear value option is not available for Required fields.

So the final Business Rule looks as below:

Now on Activating above business rule if the Credit hold field is set to No you will see that the Credit Limit field’s value is automatically cleared.

business_rule3

Setting up a formula for a numeric field.

Another thing that we have observed while working with Business Rules is that when entering a formula and setting a value in the formula, the precision allowed in the value depends on the field being selected as one of the parties to the formula rather than the precision of the field in which the result of the formula would be set.

Suppose, We want to set Budget field using following Formula:

Budget = Annual Revenue * 0.0067

So we have created a Custom field “Budget” of type currency with precision 4.

business_rule4

The Annual Revenue field is having precision 2.business_rule5

 

While writing formulas in Business rules, if we try to multiply “Annual revenue” field with a value of higher precision than the Annual Revenue field such as 0.0067.business_rule6

Then in business rules when we click on ok it rounds up the value to the precision of Annual Revenue field which is the field being selected as one of the parties to the formula and not to the precision of the field in which the result of the formula would be set which in our example is Budget.

In our case the value 0.0067 is rounded up to 0.01 due to precision of Annual Revenue is 2 not to the precision of Budget which is 4.

business_rule7

Workaround:

The workaround for this is to edit the Annual Revenue field and change its precision to higher precision. In our example the precision of Annual Revenue field is changed to 4.

business_rule8

After publishing the changes in form, we get proper precision of the field.

business_rule9

Need more from your Dynamics CRM? Avoid double entry data work. Check our Inolink to promote orders/invoices from Quickbooks to Dynamics CRM. Email us on crm@inogic.com for a trial or if you would like to see a live demo.

Leave a Reply