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