Dynamics crm 如何在更新前插件中将字段设置为null
我为案例实体开发了一个预更新插件。在这个插件中,我想将一个字符串字段设置为一个新值。 如果新值不为null,它将顺利工作。但如果新值为null,则忽略它 这项工作:Dynamics crm 如何在更新前插件中将字段设置为null,dynamics-crm,dynamics-crm-2011,Dynamics Crm,Dynamics Crm 2011,我为案例实体开发了一个预更新插件。在这个插件中,我想将一个字符串字段设置为一个新值。 如果新值不为null,它将顺利工作。但如果新值为null,则忽略它 这项工作: Incident caseTarget = ((Entity) localContext.PluginExecutionContext.InputParameters["Target"]).ToEntity<Incident>(); caseTarget.ProductSerialNumber = "new value"
Incident caseTarget = ((Entity) localContext.PluginExecutionContext.InputParameters["Target"]).ToEntity<Incident>();
caseTarget.ProductSerialNumber = "new value";
执行插件后,ProductSerialNumber字段的值为new value
这不起作用:
Incident caseTarget = ((Entity) localContext.PluginExecutionContext.InputParameters["Target"]).ToEntity<Incident>();
caseTarget.ProductSerialNumber = null;
执行插件后,ProductSerialNumber字段仍保留其旧值
如何将目标的字段设置为null?不管它是否是属性包中的属性,我都使用自定义实体对此进行了测试,并将任何字符串字段设置为null都有效。出于好奇,生成的文件中的incident类继承了哪些类?它是继承System.ComponentModel.INotifyPropertyChanged还是继承System.ComponentModel.INotifyPropertyChanged?