0

I Have a plugin that should run on delete of a custom entity that wont run.

Plugin is registered with Plugin Registrtion Tool setting:

  • Message - Delete
  • Primary Entity - myCustomEntity
  • Secondary Entity - none
  • Filetering Attributes - All Attributes
  • Plugin - the one i want to run
  • Run in user Context - calling user
  • Execurion Order - 1
  • Pre Stage
  • Synchronous
  • Step Deployment - Server
  • Trigeting Pipeline - Parent

with an image called Target registerd as a pre-image.

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.

any idea what i have done wrong?

4

2 回答 2

2

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

if (context.InputParameters.Properties.Contains(ParameterName.Target) &&
           context.InputParameters.Properties[ParameterName.Target] is Moniker)

and it works now.

于 2012-05-09T12:12:28.347 回答
0

如果您不清楚在InputParameters给定消息的 PropertyBag 中可能需要哪些参数,您可以查看 SDK 中的相应MessageNameRequest类并查看该对象的实例属性(例如,DeleteRequest该类只有一个Target属性(类型TargetDelete)。

于 2012-05-16T15:23:02.510 回答