如何在同步插件中確定哪些字段已更改?
插件在更新時註冊。
喜歡的東西的isDirty()在JavaScript:CRM 2011更新插件:更改了哪些字段?
// 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
}
如何訪問未更改的屬性? – Bvrce 2013-03-26 10:51:12
使用預映像或後映像(http://msdn.microsoft.com/en-us/library/gg309673.aspx#bkmk_preandpost) – 2013-03-26 11:19:05
我打算使用IOrganization.Retrieve,因爲Id可用,但是您的方式看起來更有效率。 – Bvrce 2013-03-26 11:28:24