简体   繁体   English

Dynamics CRM 4删除插件未运行

[英]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设置:

  • Message - Delete 消息 - 删除
  • Primary Entity - myCustomEntity 主要实体 - myCustomEntity
  • Secondary Entity - none 次要实体 - 无
  • Filetering Attributes - All Attributes 文件处理属性 - 所有属性
  • Plugin - the one i want to run 插件 - 我想要运行的那个
  • Run in user Context - calling user 在用户上下文中运行 - 调用用户
  • Execurion Order - 1 执行令 - 1
  • Pre Stage 前期
  • Synchronous 同步
  • Step Deployment - Server 步骤部署 - 服务器
  • Trigeting Pipeline - Parent Trigeting Pipeline - Parent

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM