Engage on Facebook Engage on Twitter Engage on LinkedIn Engage on GitHub components notes mobile card heart 2 infinite mirror 2 pricing support

How to Use Business Logic in Microsoft Dynamics CRM 2015

By Rich Campbell

Microsoft Dynamics Logo

With the release of Dynamics CRM 2015 we received an improved business logic system for CRM.  If we leverage business logic, we can usually eliminate a lot of javascript that may have been written for older versions of CRM.  For example, in 2011, if you wanted to hide a field on the form called name, you would need to create a new javascript file, write this code in the file: Xrm.Page.getControl("name").setVisible(false);.  Finally, you would need to save the file and publish it.  While this example is simple, most javascript files handle a lot more logic than just hiding a single field.

I'll show you a few examples on how to assign ownership of an account record based on a few different conditions below.

To begin, let's go to the customization area in your Dynamics CRM instance.  

 

Dynamics CRM Customization Area

 

After you click "Customize the System", you'll want to open up the entity you want to modify.  In the case of this example, I've chosen the 'Account' entity.

 

Account Entitiy Example

 

Click on 'Account', then 'Business Rules', and finally click 'New' to create a new business rule.

 

As soon as you click 'New', you'll get a new dialog box to create the new rule.  I like to be very descriptive when making a rule, as you'll notice in the title of the screenshot below.  This helps me come back to a rule months later and immediately understand what it does.

Buisness Rule Screenshot

 

In this rule, I said that if the category has a value of 'Preferred Customer' then to set the ownership of the record to Jason Stone (Our lead Sales Person).  This example is very simple but we can actually make more complicated scenarios by using and/or conditions (new to 2015) before we do the action. I'll show an example below where we say: "if Category has a value of 'Preferred Customer' AND their credit limit is greater than 75000, then assign the ownership of the account to Jason Stone. See the screenshot to see how easy it is to add a condition.

Business Rule Condition Screenshot

 

We can do a lot more with business rules like hiding sections and tabs based on certain conditions,  but we'll save that for another blog post. As always, feel free to leave a comment below with any questions and I'll try to reply in a timely manner.  Until next time, happy CRM'ing!

 

 

Planning a DNN upgrade? Download our guide