- April 26, 2016
- Posted by: Raz Dynamics
- Category: Microsoft Dynamics CRM
Microsoft Dynamics CRM 2013 introduced Business Rules, CRM 2015 introduced Rollups and Calculated Fields and CRM 2016 added further improvements. I wrote this post to help a CRM Community member on the forum requesting a comparison table for Business Rules, Rollup and Calculated field features. It can be common dilemma when trying to decide when is the most suitable time to use each of these customisation features so I hope the following table will help easily clarify the best scenarios for usage.
Feature | Trigger | Execution | Client / Server | Scope | Conditions | Fields | Functions | Limits | Usage |
Business Rules
|
On Load
On Change |
Synchrounous / Real Time
Execution order: First: System JavaScripts Then: Custom Javascript Finally: Business Rules |
Client: Specific Forms/ All Forms/
Server |
Entity / All Forms / Specific Forms | And / OR, not a mixure | All Fields on the form body |
|
Fields updated through Business Rules do not trigger the fields on change event of JavaScript. Reducing potential of infinite loop. | Perform field validations and apply field logic to improve user input and experience |
Rollup Fields | On Save / Every 1-12 hours / When User Presses Rollup Refresh Button | Asynchronous / Every 1-12 hours
Rollups are calculated by scheduled system jobs Settings > System Jobs > View > Recurring System Jobs. System Job type: Mass Calculate Rollup Field or Calculate Rollup Field |
Server | Related Entity / Parent Child Relationship Upto 1 Level Deep | And / OR, not a mixure | Whole Number
Decimal Currency Date |
SUM / MAX / MIN / COUNT / AVG | Cannot use other Calculated or Rollup fields as part of a rollup. | Aggregate calculations of child entities. The difference between Calculated Fields is Rollup fields are not virtual, they are physical attributes. Such as no. of open opportunities, activities, revenue, etc. |
Calculated Fields
|
OnSave | Synchronous | Server | Entity/ Parent Child Relationship Upto1 Level Deep | AND or OR , Not a mix of both |
|
ADDHOURS,
ADDDAYS, ADDWEEKS, ADDMONTHS, ADDYEARS, SUBTRACTHOURS, SUBTRACTDAYS, SUBTRACTWEEKS, SUBTRACTMONTHS, SUBTRACTYEARS, DIFFINDAYS, DIFFINHOURS, DIFFINMINUTES, DIFFINMONTHS, DIFFINWEEKS, DIFFINYEARS, CONCAT, TRIMLEFT, and TRIMRIGHT. |
Two calculated fields cannot reference each other in their formulas
Floating point numbers cannot be used in calculated fields. Won’t trigger workflow updates Fields are virtual /not stored at the database level |
Ability to populate a field with simple calculations based on other values and conditions on the form in a real time manner. This alleviates the need for JavaScript in fairly straight forward scenarios such as adding days or months to a date, or adding or subtracting fields on the same entity.
Calculated fields can calculate based on other fields, including rollup fields and other calculated fields. |
Business Rules
https://technet.microsoft.com/en-us/library/dn531086.aspx
Rollup Fields
https://technet.microsoft.com/en-us/library/dn832162.aspx
Calculated Fields
1 Comment
Comments are closed.
[…] http://www.crmconsultants.co.uk/business-rules-vs-rollup-fields-vs-calculated-fields/ https://technet.microsoft.com/en-us/library/dn531086.aspx https://technet.microsoft.com/en-us/library/dn832162.aspx https://technet.microsoft.com/en-us/library/dn832103.aspx […]