Hi,
Recently we were writing a plugin that should fire when a record is activated.
In this kind of scenario, it is suggested\recommended to register plugin in both SetState and SetStateDynamicEntity message.
https://community.dynamics.com/crm/f/117/t/184070
https://blogs.msdn.microsoft.com/crm/2008/03/07/developing-plug-ins-for-crm-4-0/
Interestingly we had the following observations
- The Plugin fires only for SetStateDynamicEntity message.
- The Plugin fires even if the SetState message step is disabled or not registered.
- Only SetStateDynamicEntity message is fired when the record is Activated or Deactivated. For incident entity also, it was the only message fired on Reactivating the record. The plugin didn’t trigger in case of Resolve or Cancel Case.
- Only SetStateDynamicEntity message is fired, even if we are updating the state of the record using SetStateRequest of SDK.
- As SetStateRequest message is deprecated, if we use UpdateRequest to update the state of the record, the plugin that is registered on SetState and SetStateDynamicEntity will not fire. It will trigger only if registered for Update message.
Plugin Trace log records :-
We are yet to figure out when exactly the SetState will be fired. Please share your thoughts and experience around the same.
Hope it helps..
Hi Nishant,
Thanks for this article. It is an interesting question you pose.
As per this article: https://msdn.microsoft.com/en-us/library/gg328078.aspx, SetStateDynamicEntity is the message name and SetState is the messageRequest Name.
LikeLike
Check this https://twitter.com/nishantranaCRM/status/1016953515548258305
LikeLike