Search This Blog

Tuesday, July 7, 2009

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.

2 comments:

a33ik said...

It is easier to handle both this messages in plugin from my experience )

Aaron said...

So if i want to fire a plugin on the fulfillment of a salesorder I can use SetSateDynamicEntity as message?