How can it be determined in a synchronous plug-in which fields changed?
The plug-in is registered on update.
Something like an isDirty() in JavaScript:
// TODO: Implement your custom Plug-in business logic.
IOrganizationService service = localContext.OrganizationService;
Entity account = (Entity)localContext.PluginExecutionContext.InputParameters["Target"];
if (account.GetAttributeValue<String>("address1_latitude").isDirty())
{
service.Create(new Lead { FirstName = "LOCATION CHANGED" }); // this is a stub
}
The attributes that are actually present in the Target are the ones that have changed. Unchanged attributes don't appear there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With