如何在同步插件中确定哪些字段发生了变化?
插件在更新时注册。
类似 JavaScript 中的 isDirty() 的东西:
// 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
}