What is a Plugin?
A plug-in is custom business logic (code) that you can integrate with Microsoft Dynamics CRM Online or OnPremise to modify or augment the standard behavior of the platform.
Event execution pipeline
The Microsoft Dynamics CRM event processing subsystem executes plug-ins based on a message pipeline execution model. A user action in the Microsoft Dynamics CRM Web application or an SDK method call by a plug-in or other application results in a message being sent to the organization Web service. The message contains business entity information and core operation information. The message is passed through the event execution pipeline where it can be read or modified by the platform core operation and any registered plug-ins.
Note: While there are several Web services hosted by the Microsoft Dynamics CRM platform, only events triggered by the organization and OData endpoints can cause plug-ins to execute.
Architecture and related components
The following figure illustrates the overall architecture of the Microsoft Dynamics CRM platform with respect to both synchronous and asynchronous event processing.
Points to Remember:
- The event execution pipeline processes events either synchronously or asynchronously.
- The platform core operation and any plug-ins registered for synchronous execution are executed immediately.
- Synchronous plug-ins that are registered for the event are executed in a well-defined order.
- Plug-ins registered for asynchronous execution are queued by the Asynchronous Queue Agent and executed at a later time by the asynchronous service.
- Regardless of whether a plug-in executes synchronously or asynchronously, there is a 2 minute time limit imposed on the execution of a (message) request. If the execution of your plug-in logic exceeds the time limit, a System.TimeoutException is thrown. If a plug-in needs more processing time than the 2 minute time limit, consider using a workflow or other background process to accomplish the intended task.
Pre Image: A pre-image is a snapshot of the entity’s attributes before the core operation.
Availability of Pre Images for the Plugin stages,
Post Image: A post-image is a snapshot of the entity’s attribute after the core operation.
Availability of Post Images for the Plugin stages,