在dynamics CRM中,我可以使用插件监控字符串映射表的更新吗?我只需要监视一个属性,比如AttributeName='abc‘
我在plugin XML配置文件中添加了以下项,导入XML文件后,PrimaryEntity为none。
<Step PluginTypeName="Classes.Ind" Description="Ind PreCreate" InvocationSource="0" MessageName="Create" Mode="0" PrimaryEntityName="stringmap" SecondaryEntityName="none" Stage="10" SupportedDeployment="0" Rank="1" Id="B53A4743-*">发布于 2014-05-06 04:31:38
利用定制的唯一方法是监听Publish或PublishAll消息。在您的插件中,您将需要处理定制xml (XmlDocument)以进行特定更改。
例如:
<importexportxml>
<optionsets>
<optionset>new_myoptionset</optionset>
</optionsets>
</importexportxml>当您在Publish或PublishAll消息上注册插件时,context.InputParameters密钥对应于publish请求的公共属性。
在本例中,您需要将ParameterXml读取到XmlDocument中并搜索您的选项集更改。
这可能如下所示:
if (context.Message == "Publish"" && context.InputParameters.Contains("ParameterXml"))
{
XmlDocument xCust = new XmlDocument();
xCust.Load(context.InputParameters["ParameterXml"].ToString());
// look for your optionset using xpath …
}https://stackoverflow.com/questions/23480898
复制相似问题