With the launch of Microsoft Dynamics CRM 2016 earlier this Spring, calculated fields were introduced. This new field type can be set up to provide ‘Excel-like’ formulas and calculations at the field level and can be set up by a non-technical system customizer. Previous to Dynamics CRM 2015, scripts, plugins, and workflows had to be implemented to mirror this functionality. When setting the value in a calculated field, the following math operators are available:
The following String Functions are available for single line fields,
TRIMLEFT (trims characters from the left to right)
TRIMRIGHT (trims characters from the right to left)
CONCAT (add single lines of text together)
The following Date/Time Functions are available for Whole Number or Date/Time fields:
With the release of update 2015 Update 1, the following additional functions are now available:
NOW (gives current date and time)
This is a very powerful and useful new feature. In the scenario below, we will set up a calculated field in CRM to track the number of days that a case has been open.
Add a new field to the case entity called ‘# of Days Open’
Specify data type as whole number and field type as calculated (as see in the screenshow below)
Click ‘Edit’ to the right of the field type and specify that you only want this to calculate if the status is open (since we only want to count # of days open in this field). Set the function to calculate the difference in days between the ‘created on’ date and ‘now’ (as seen below).
Click Save and Close to exit the screen above and then click Save and Close again to exit the field set up screen.