Custom workflow Debugging in MSCRM

With the help of "plugin registration" we can debug the custom workflow. You must first define/register your custom workflow in the CRM by adding steps in your process. Follow the below steps to debug it.

1) Open the plugin registration tool and connect to CRM.

2) If you don’t have the Profiler installed, click the “Install Profiler” button which is showing below

clip_image002

3) After Profile installing, plugin registration tool shows “Uninstall Profiler” button and a new item ‘Plug-in Profiler’ is added in the registered components as shown below.

clip_image004

4) On select of Plugin-in profiler you will find “Profile Workflow” button in the top menu click on that button

clip_image006

5) In profile settings window select your workflow in the workflow dropdown and steps will be automatically populate check it and select radio button “Persist to Entity “ and note that “Persistence Key” value for future use and then Click on “ok” .

clip_image008

6) After click ok button. If the error occurs "Automatic workflow cannot be published if no activation parameters have been specified" then you have to configure workflow in CRM as "On Demand" to solve this error.

7) Notice the Profiled item added as the sub item to the Plugin-in Profiler.

8) Go to process now you can see your selected workflow added with name embedded with profiled.(i.e., On Purchase Order Receive Email to Estimator (Profiled))

9) Now you can Trigger the relevant workflow.

10) Once you triggered the workflow. Go to "plugin profiles" in below location i.e., Go to Settingsà Extensionsà Plug-in Profiles.

clip_image010

11) Open the Relevant Plugin-in Profile record, make sure the Persistence key matches the one you have copied earlier.

12) Now open the Serialized Profile tab and copy the text and save that in new text file.

clip_image012

13) Now open the plugin registration tool and select plug-in profile then debug button will be displayed click on that button.

clip_image014

14) In the opened debug window select the newly created text file in the profile field and in the assembly Location select the custom workflow activity assembly (dll).

clip_image016

15) Now go to the visual studio and place some break point in code then attach to process as shown below

clip_image018

16) In available Process select the “Plugin Registration tool” as below

clip_image020

17) Click the Start Execution button in the Plugin Registration Tool debug window.

18) Now Breakpoint should be hit and from now on you can edit your code and debug locally.

No Comments

Add a Comment

  1. (max length 2000)
  2. captcha refresh captcha