Plugin Profiler In Dynamics CRM

Introduction

 
The plugin has always been an important component in any implementation of Dynamics CRM, as they equip the developer to implement logic which is not a part of the application and thus empowers them to meet their business requirements.

Plugins in Dynamics CRM are basically custom code that is triggered based upon the message, which can be anything, such as the creation of the record or updating the record. For every entity, we have a different set of messages
 
At times, the custom code which has been registered by the developer in the application doesn’t execute as expected, which leads to issues failures in the execution of the business implementation when been used by a real-time business user.
 
Now there comes an issue, the developer cannot go for each business user and validate the code or business scenario. So Microsoft introduced the unique concept of having a plugin profiler.
 
A plugin profiler is a unique concept which needs to be enabled by the developer on the specific message, and then whenever the plugin is executed. A profile of the same is created and stored in an application that can be referenced back to by the developer at any time in the future to execute the code using the same context under which that particular scenario has been executed. We can say it is as good as executing the plugin back with inputs again to debug the code.
 

Steps

  • Using the Plugin Registration Tool of Dynamics CRM, we need to enable the plugin profiler.

    Plugin Profiler in Dynamics CRM

  • Once the Profile has been installed and enabled, you need to go the plugin for which the business user is reporting the error and need to start the profiling.

    Plugin Profiler in Dynamics CRM
On Click of the “ Start Profiling”, another pop up window will be opened which will offer you certain more number of options, like whether you want to store the profile in an entity or you want the same to be downloaded, which user need to share with you over email.

Another option is whether you want the profile traces to be created specifically for exceptions, or just for every execution of plugin. For our specific case, I am selecting for all execution.
 
Plugin Profiler in Dynamics CRM
 
Post this whenever any user will be performing any action in Dynamics CRM, where this plugin will be triggered then a record will be created in Plugin Profiles entity, and we can find the record through Advance Find in application.
 
Plugin Profiler in Dynamics CRM
Once the record has been created in the Plugin-Profiles entity, then we need to attach the Plugin Registraton.exe in our visual studio and click on the button “Start profiling” over the plugin registration tool, which as a result will trigger the debugging in the class file. Remember to add a breakpoint in the code.
 
To open this window – Ctrl + Alt+ P
 
Plugin Profiler in Dynamics CRM
 
Click on Plugin Registration Tool
 
Plugin Profiler in Dynamics CRM
 
This will open a new window where you need to select the record from the Plugin Profiles entity and the assembly for the plugin. Then the plugin debugger will be there assisting you to debug the code.


Similar Articles