Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Calculated fields with NULL value returns NULL

Posted on by Microsoft Employee

I am new to Dynamic 365 CRM and am having issue with the formula in calculated fields. The calculated field is a sum of 5 currency fields and it shows up as NULL if any one of the currency field is NULL. From my research it looks like I have only 2 options

1) Create a workflow to update these fields to $0 on create/update entities.

Note: This may not be ideal for all situations to store $0 for NULLS in all the entities. Also we may need to update the existing records.

2) Create a calculated field for each of the NULL field to store $0 instead of NULL and use the new calculated fields in the formula instead of the original fields.

Note: This sounds logical but adding additional calculated fields for each field in a formula seems to be redundant.

I looked at the available formulas in the calculated fields but looks like there is none for the currency fields. Both these approach has pros and cons, is there a better way to handle NULL's in the calculated fields. 

Thanks.

*This post is locked for comments

  • Verified answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Calculated fields with NULL value returns NULL

    Hello,

    Then you will have to leave idea of code-less solution behind and use plugins for calculations.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Calculated fields with NULL value returns NULL

    Thanks for the reply Shoaib.

    In our application, we cannot set the currency fields to be $0, for example, for a bank statement, balance of NULL is totally different from $0.

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Calculated fields with NULL value returns NULL

    Hi,

    It is best practice to set currency to 0 by default as they are required in calculation.

    One option is to populate these fields to 0 using Business Rules. Have a look at below article.

    http://www.marksgroup.net/blog/dynamics-365-using-business-rules-set-default-values/

    You can run a background workflow to set existing null values to 0 or export all records and re import after setting it to 0 in excel or excel online.

    Thanks, 

    Shoaib

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans