Event Pipeline

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:

Pre-event/Pre-Validation

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.

Example uses:
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.

Tip! Want to learn Dynamics 365 development skills?  Check out Developer Environment and Developer Extending events.

Pre-event/Pre-Operation

This stage executes after validation, but before the changes has been committed to database. This is one of the most commonly used stages.

Example uses:
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.

Post-Event

This stage executed after changes have been committed to database. This is one of the most used stages.

Example uses:
Most of the “Create” plugins are post-event. This allows access to the created GUID and creation of relationships to newly created record.

Post-Event/Post-Operation (deprecated)

This stage only supports Microsoft Dynamics CRM 4.0 based plug-ins.


Do More with Dynamics 365

Expand your knowledge of Dynamics 365 through PowerObjects’ educational blogs.  Looking to learn in a more formal setting?  Check out our in-person training courses.

Want to learn development skills?  Check out Developer Environment and Developer Extending events.