How to handle Nulls in Dataverse Calculated Fields
By Joe GillPublished On 1st August 2016
One of the little wrinkles with Dataverse 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 customer’s 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.
Leave A Reply
You must be logged in to post a comment.