CRM 2011 - Rollback mechanism for triggering a plugin within another plugin
As long as the plugins are registered in the transaction (before or after, but still in), everything will get rolled back. If a plugin is registered for the Pre-Validation
stage, it will not get rolled back.
This also assumes that you're retrieving the IOrganziationService
from the PluginContext
as well.
This is what happens on the server:
- A request to update an entity comes in, are we currently in a transaction via the context? If not create a new Database Transaction and store it in the Plugin Context.
- Request is made to update a different entity, transaction is passed to the new plugin's context, and step 1 is repeated for new plugin execution.