Event Pipeline in Dynamics 365
The event pipeline allows you to configure when in the event the plug-in code will execute. The event pipeline is divided into the following events and stages:
This stage executes before anything else, even before basic validation if the triggering action is even allowed based on security. Therefore, it would be possible to trigger the plug-in code even without actually having permission to do so and great consideration must be used when writing a pre-validation plug-in. Also, execution in this stage might not be part of the database transaction.
Some “delete” plug-ins. Deletion cascades happen prior to pre-operation, therefore if you need any information about the child records, the delete plugin must be pre-validation.
This stage executes after validation, but before the changes has been committed to database. This is one of the most commonly used stages.
If and “update” plug-in should update the same record, it is best practice to use the pre-operation stage and modify the properties. That way the plug-in update is done within same DB transaction without needing additional web service update call.
Platform Core Operation
This stage is the in-transaction main operation of the system, such as create, update, delete, and so on. No custom plug-ins can be registered in this stage. It is meant for internal use only.
This stage executed after changes have been committed to database. This is one of the most used stages.
Most of the “Create” plugins are post-event. This allows access to the created GUID and creation of relationships to newly created record.
This stage only supports Microsoft Dynamics CRM 4.0 based plug-ins.