Plugins and update record state: Do I have to use message SetState or SetStateDynamicEntity

One question that came to me while I had to develop a plugin when record state changed...

The answer is quite simple if you understand how the CRM application communicates between the presentation layer and data access layer. In fact, all communications between the forms and the data access layer seem to be in the form of DynamicEntity.

So when you change the status of a record via the forms, or when you use the SDK class SetStateDynamicEntityRequest, you register your plugin on the SetStateDynamicEntity message .

If you use in your code SetStateAccountRequest class (for example), you must register your plugin on the SetStage message.

Comments

Unknown said…
It is easier to handle both this messages in plugin from my experience )
Unknown said…
So if i want to fire a plugin on the fulfillment of a salesorder I can use SetSateDynamicEntity as message?

Popular posts from this blog

Use feature flags in your plugins

New XrmToolBox plugin : Import/Export NN relationships

Searchable Propery Attribute Updater