Monday, July 24, 2017

Business Rules Vs Rollup Fields Vs Calculated Fields


FeatureTriggerExecutionClient / ServerScopeConditionsFieldsFunctionsLimitsUsage
Business Rules

OnLoad
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 FormsAnd / OR, not a mixureAll Fields on the form body
  • Show Error Message
  • Set Field
  • Set Business Required
  • Set Visibility
  • Set Default Value
  • Lock / Unlock Field
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 FieldsOn Save / Every 1-12 hours / When User Presses Rollup Refresh ButtonAsynchronous / 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
ServerRelated Entity / Parent Child Relationship Upto 1 Level DeepAnd / OR, not a mixureWhole Number
Decimal
Currency
Date
SUM / MAX / MIN / COUNT / AVGCannot 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

OnSaveSynchronousServerEntity/ Parent Child Relationship Upto1 Level DeepAND or OR , Not a mix of both
  • Single line of text
  • Option Set
  • Two Options
  • Whole Number
  • Decimal Number
  • Currency
  • Date and Time
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.

No comments:

Post a Comment

Get files of last hour in Azure Data Factory

  Case I have a Data Factory pipeline that should run each hour and collect all new files added to the data lake since the last run. What is...