When does the Plugin registered on SetState message fires in Dynamics 365?

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..


Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

3 thoughts on “When does the Plugin registered on SetState message fires in Dynamics 365?”

Share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.