[英]Dynamics CRM 4 Delete Plugin not running
I Have a plugin that should run on delete of a custom entity that wont run. 我有一个插件应该删除一个不会运行的自定义实体。
Plugin is registered with Plugin Registrtion Tool setting: 插件注册了Plugin Registrtion Tool设置:
with an image called Target registerd as a pre-image. 将名为Target的图像注册为预图像。
there are no errors logged on the server and debuging in visual studio with a breakpoint on the first statements in the constructor and execute methods does not result in it entering debug. 在服务器上没有记录错误,并且在visual studio中使用断点对构造函数中的第一个语句进行调试,并且执行方法不会导致它进入调试。
any idea what i have done wrong? 我知道我做错了什么?
Figured it out, i had this line 弄清楚,我有这条线
if (context.InputParameters.Properties.Contains(ParameterName.EntityMoniker) &&
context.InputParameters.Properties[ParameterName.EntityMoniker] is Moniker)
which is how it works for MessageName.SetStateDynamicEntity, changed to 它是如何为MessageName.SetStateDynamicEntity工作的,改为
if (context.InputParameters.Properties.Contains(ParameterName.Target) &&
context.InputParameters.Properties[ParameterName.Target] is Moniker)
and it works now. 它现在有效。
如果您不清楚InputParameters
PropertyBag中对于给定消息可能期望的参数,您可以查看SDK以获取相应的MessageNameRequest类,并查看该对象的Instance Properties(例如, DeleteRequest
类只有一个Target
属性) (类型为TargetDelete
)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.