Quantcast
Channel: Forum CRM Development
Viewing all articles
Browse latest Browse all 1000

CRM 2011: How to find dirty fields in plugin update using post image?

$
0
0

Hello,

I have a plugin runs update and I have a post image for this plugin. In my plugin, I use late bound. I want to find some dirty fields value(the fields value is changed after update) to compare the difference before and after updating.

For example, I was trying to use following code to get dirty fields value, but I found they're same, so what's wrong with my code? How can I get these fields value(before and after updating)?

Entity updateEntity = (Entity)this.context.InputParameters["Target"];
Entity postEntity = (Entity)this.context.PostEntityImages["Target"];
bool dirtyFieldCurrent = updateEntity.GetAttributeValue<bool>("dirtyfield");
bool dirtyFieldPOST = postEntity.GetAttributeValue<bool>("dirtyfield");

'dirtyfield' is the one should changed when running update, but I found in my code dirtyFieldCurrent is same as dirtyFiledPOST.

Any help will appreciate.

Thanks.


Viewing all articles
Browse latest Browse all 1000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>