Views:

Introduction to Business Rules:

Business rules were added to CRM 2013 and a way to provide client side scripting/validating/field or section hiding without having to write any JavaScript

Business rules are also known as portable business logic because they also work on the mobile app.

 

A Business Rule can perform below operations:

          • A Set field values
          • Show/hide fields – Visibility
          • Enable/disable fields
          • change the requirement levels on fields (e.g. business required, recommend)
          • Show error message

 

Purpose of Business Rules:

Business rules are useful because they allow non developers to provide the functionality mentioned above on forms. Business rules can be used on Main and Quick Create Forms.

Disadvantages with the Business Rules:

  • Business rules will not work when there is an onchange event on the triggering of the field.

  • On saving of record also business rules will not work.

  • Business rule will work only the field is on the form and/or on change of the value.

  • No grouping of expressions in a condition

  • Expressions can be combined either using And, or using Or, but not both

  • Still single entity only (no ability to reach out to related records)

  • Logic in business rules is applied. When there are multiple business rules, they are applied in the order they were activated, from oldest to newest.

 

How the Business Rules works in real time scenario:

The Navigation for the Business Rules are Settings –> Customization –> Select the Entity –> Business Rules

 

 

               image

 

You can able to define the conditions in business rule and the scope can be set as All Forms or to a specific form as per required.

 

 

              image

Scope for Business Rule:

A business rules have a scope but business rules are only concerned with forms.  The scope choices are

      • All Forms
      • Choose one of the main forms

If you choose all forms, the business rule will run on the main form and Quick Create form but you cannot individually choose a Quick Create form.

   The Logic behind the business Rules are:

    • Business rules get converted in JavaScript by CRM and then applied to the form. 
    • Business rules only work client side (not server side like workflows and plugins). 
    • The downside to this is business rules only get triggered on the form and not if the data is updated by any other means (bulk update, plugins, etc.)