web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
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. 

I have the same question (0)
  • Verified answer
    Mahendar Pal Profile Picture
    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.

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

    Thank you Mahen, it works!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Sahan Hasitha Profile Picture

Sahan Hasitha 271

#2
Sohaib Cheema Profile Picture

Sohaib Cheema 102 User Group Leader

#3
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 83

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans