Plug-in is a .NET assembly written to intercept the events generated from CRM system so as to modify or augment the standard behavior of the platform. When we talk about registering a plug-in it implies that we are subscribing to the events from the CRM system.
Scenarios where plug-in can be used:
- Legacy system integration
- Extending or customizing the behavior of the CRM system.
In the most simplest scenario we can consider a record created in Account entity as an event.
There are two execution modes available for plug-in’s in CRM platform viz., synchronous and asynchronous.
Synchronous Mode: Blocks the CRM application from start of the event until it is completed.
Asynchronous Mode: Release the application process so the user can continue to work with CRM application. Asynchronous Service (Asynchronous Processing Service) of the CRM platform does the execution of the plug-in configured in this mode.
The event pipeline is configurable and we can specify when in the event the plug-in code will execute. In this context there is Pre-Event and Post-Event stages(before and after scenarios). The stages are now part of SQL transactions and rollback can be performed.
The Developer Toolkit that comes as part of CRM 2013 SDK allows integration into VS2012 IDE providing templates to create solutions comprising of Plug-in’s, Workflow, Silverlight components.
Once the template is selected a dialog appears to allow connection to CRM system
The Organization and Solution Name drop down lists provides the option of selecting a available solutions for Organization. The final solution structure looks like below:
Important files in the above solution snap shot include:
CrmPackage: Contains the RegisterFile.crmregister hold the information regarding the plugin in xml format. The details available are used to deploy the plug-in to CRM
Plugins , Workflow: .NET Assembly projects
In Part 2 I will be implementing custom logic to create a Task on creation of Account.
Pingback: Plug-in Dynamics CRM – Part 3 | gsrinivasablog