Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

c# get calculated field value

Posted on by 2,397

Hi, I am trying to get calculated field value, is that the same as get the value from regular field, like the below, I keep getting "object reference not set to an instance of an object", the record should contain the data.

invoice.GetAttributeValue<Money>("averageAmount")


*This post is locked for comments

  • Verified answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: c# get calculated field value

    Hi ,

    You are correct , this is the way you can retrieve the calculated Field based on field type.

    Money MyFieldValue = (Money)ContextEntity.GetAttributeValue<Money>("FieldNAme");

    Seems the field name you are using "averageAmount" its correct ? Please use schema name .

  • Shaminderpal Singh Profile Picture
    Shaminderpal Singh 1,565 on at
    RE: c# get calculated field value

    Yup we can get it as you have written but make sure to use logical name not schema name ,in your screenshot it appears to be schema name

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

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