Monday, August 01, 2016

How to handle Nulls in Dynamics CRM Calculated Fields

One of the little wrinkles with calculated fields is that they cannot handle nulls and so if one of the values in the calculation is null then the calculated field value is null. 

In this example I have four custom fields on the opportunity entity to track the customers estimated sales by quarter.

The calculated field that totals the four custom fields.

A way to avoid this is to create a calculated field for each nullable sales field. This new calculated field returns zero if the sales field does not contain data.

I will then use the new fields in the total calculation field.

The total is now calculated even if the user does not enter values for all four sales quarters. I like this approach as it does not require any coding or populating nullable fields with zero values unnecessarily.

1 comment:

  1. Finding the time and actual effort to create a superb article like this is great thing. I’ll learn many new stuff right here! Good luck for the next post buddy.

    I will bookmark your site and check again here often. I’m quite sure :)

    ERP Software Dubai