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:

  • = (Equal)
  • + (Plus)
  • – (Minus)
  • / (Divide)
  • * (Multiply)

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:

  • ADDHOURS
  • ADDDAYS
  • ADDWEEKS
  • ADDMONTHS
  • ADDYEARS
  • SUBTRACTHOURS
  • SUBTRACTDAYS
  • SUBTRACTWEEKS
  • SUBTRACTMONTHS
  • SUBTRACTYEARS

With the release of update 2015 Update 1, the following additional functions are now available:

  • DIFFINDAYS
  • DIFFINHOURS
  • DIFFINMINUTES
  • DIFFINMONTHS
  • DIFFINWEEKS
  • DIFFINYEARS
  • 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)

CRM Functions 1

  • 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).

CRM Functions 2

  • Click Save and Close to exit the screen above and then click Save and Close again to exit the field set up screen.
  • Add the field to your form and be sure to publish

Here is the field on the case record:

CRM Functions 3

For more Microsoft Dynamics CRM tips and updates be sure to subscribe to our blog. Also you can check out our whole archive of blog posts on Dynamics CRM for all our previous postings on other tips and tricks.

Contact Us Today

To learn more about Ledgeview’s Expertise

Related Articles

Read More