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.