Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

When update a record, type value is sending null

(0) ShareShare
ReportReport
Posted on by 50

Hi everyone,

I have a plugin and the plugin check type field. If type value is equals to 0 or 3, there are two decimal field and they should be not empty. When I update the decimal field to null and there is no update on the type field at the same time, option value is null in plugin. Why is that reason? 

Thanks. 

  • Efnan Profile Picture
    Efnan 50 on at
    RE: When update a record, type value is sending null

    Thank you Mahen, it works!

  • Verified answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: When update a record, type value is sending null

    Hi,

    In your plugin entity collection you will only get the dirty fields so as user is not doing any changes you won't get the type field.

    You need to register a preimage in your plugin where you need to add your type field, and in your code check if the type field is available in the entity collection get it from there (means user updated this field) and it this field is not there get it from the preimage ( it will be always there) so it will be something like below

    if (pluginContext.PreEntityImages.Contains("preimage"))

               {

                   preimageobject = pluginContext.PreEntityImages["preimage"];

               }

    if(yourentityobject.contains("yourtypefieldname")

    {

    //get type from the entity collection which you are doing currently

    }

    else if(preimageobject .contains("yourtypefieldname")

    {

    //get type from the preimage.

    }

    You can refer this post for how to work with plugin images: carldesouza.com/.../

    let me know if you need more details on this.

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

News and Announcements

Announcing Category Subscriptions!

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans