仅在关闭appoment时触发插件

时间:2014-07-11 16:47:36

标签: dynamics-crm-2011 dynamics-crm

亲爱的,我有一个问题 我必须在按钮预约关闭时点击

才能启动插件

2 个答案:

答案 0 :(得分:1)

您可以使用SetState和SetStateDynamicEntity消息来实现。基于消息 InputParameter将相应更改。以这种方式你必须触发插件。这里的代码供您参考。

if (context.InputParameters.Contains("EntityMoniker") && 
context.InputParameters["EntityMoniker"] is EntityReference) 
{ 
EntityReference myEntity = (EntityReference)context.InputParameters["EntityMoniker"];
} 

答案 1 :(得分:0)

你不能这样做,但你可以在statuschange或更新和监视状态代码上注册你的插件。

// statecodes http://mostlymscrm.blogspot.co.at/2012/06/entity-statecodes-and-statuscodes.html

if(targetEntity.Contains(" statecode")&& targetEntity.getAttributeValue(" statecode")。Value == 2){ // mycode的 }