Creating Business Rules in CRM 2013


One of new feature added in new release of CRM 2013 is Business Rule. Though this is not very exciting feature provided by CRM 2013 but obviously this is something which developers can relish as it minimizes the burden of common JavaScript validation. Yes that’s true with the use of Business Rules we can easily perform few simple validation in the form without writing a single line of code.

Wow!!!! It sounds great… Let us have a quick walk through of this new feature and see how we can incorporate this for our requirements.

 Example:

When a lead source is changed to Partner – I want to make

1. Business Phone and Email as Mandatory Fields

2. Hide the Mobile Phone Field

Now let us create a Business Rule to meet the above requirement.  Business Rules comes as a part of your entity in the solution as shown below.

BusinessRulesAppear

Go to Business Rules for Lead entity and Create a new one. Here we can notice that we can do the following things

1. Add Conditions

2. Add Actions

3. Provide Description

In this example we have added one condition as if the lead source is Partner. In actions we can see that we are making the Business Phone as Mandatory, Hiding the Mobile Phone field and Making the email as Mandatory.

CreatingNewBusinessRules

There are very limited options available for the creating the actions like as shown below.

ActionsBusinessRules

Once we are done with the creation part we need to save this and activate. Similar to Processes we can activate and deactivate this Rules at any point of time. Also if we have multiple forms then we can also define for which forms these rules should be applied.

ScopeBusinessRules

One good I liked the most is that there is a Save As Option available so we can create multiple rules in minute and then edit accordingly.

Now we can see the desired result in the lead form(UI)LeadUI

Key points to be noted

1. If there is JavaScript written for same field then it executes before your custom business rules(Java script fires before Business Rules).

2.  It does not supports hiding/Showing  Tabs and Sections.

3.  This is similar to JavaScript so these rules do not trigger when any operation is performed by API calls.

4. Well supported in Mobiles and Ipad.

5. Rules can be applied form wise. So in case of multiple forms you may specify for which forms these rules is applicable for.

Advertisements

, , ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: