The Calculated fields can be created for the following formulas. As the names of the formulas are self-explanatory, we will not go through their explanation:
- ADDHOURS
- ADDDAYS
- ADDWEEKS
- ADDMONTHS
- ADDYEARS
- SUBTRACTHOURS
- SUBTRACTDAYS
- SUBTRACTWEEKS
- SUBTRACTMONTHS
- SUBTRACTYEARS
- DIFFINDAYS
- DIFFINHOURS
- DIFFINMINUTES
- DIFFINMONTHS
- DIFFINWEEKS
- DIFFINYEARS
- CONCAT
- TRIMLEFT
- TRIMRIGHT
The following are some examples where we can use the Calculated fields:
- As a requirement, we need to capture a follow-up date, which should be a week after the opportunity has been created. Note that there may be more than one way of achieving the requirements, such as in this case, by creating an out-of-box workflow. However, the main idea is just to show how Calculated fields work.
- Applying some sort of predecided criteria and combining the values present in different string objects is another example.
The following are some limitations of the Calculated fields:
- A Calculated field cannot refer to itself in the formula.
- We can configure a Calculated field such that its value is determined by another Calculated field. However, the maximum level of this dependency is five.
- Duplicate detection rules are not triggered on Calculated fields.
Duplicate detection rules in Dynamics CRM allow a user to identify whether there are other records in the system with the exact same attribute values. Unfortunately, we cannot set a duplicate detection job on a Calculated field.
Refer to the following MSDN link, which explains the duplicate detection rules:
https://msdn.microsoft.com/en-us/library/gg309427.aspx
Refer to the following MSDN link, which explains the duplicate detection rules:
https://msdn.microsoft.com/en-us/library/gg309427.aspx
- A workflow or plugin cannot be triggered on Calculated field updates.
While discussing the concept of Rollup/Calculated fields, it would be beneficial to go through relationships once.