Search This Blog

Friday, October 9, 2015

Debug custom workflow in CRM

Debug custom workflow in CRM 

If you have any doubt in the post please post comments. I will try to solve your problem.

To debug the custom workflow in CRM on premises and online is different ways. 
CRM OnPremises
In CRM on-premises sever attach the below process to debug custom workflow.
  • w3wp.exe
  • crmAsyncService.exe
If the custom workflow is configured as "Async" then you have to attach both process in the visual studio and trigger the workflow

If the custom workflow is configured as "Sync" then you have to attach w3wp.exe process in the visual studio.
This is way can't be use in CRM online.

CRM OnLine
With the help of "plugin registration" we can debug the custom workflow.I have mentioned below the steps to debug it.

You must first define/register your custom workflow in the CRM by adding steps in your process.

Step:1 Open the plugin registration tool and connect to CRM online. Click install profiler if it not installed already


Step:2 Once you installed profiler you can select the plugins profiler and click "profile workflow"
Step:3 In profile settings window select your workflow in the workflow lookup and steps will be automatically populate check it. If steps is not populate then you have to use your custom workflow in the CRM and come again and do it. 



Step:4 Check the persist to entity and click ok button

Step:5 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 "OnDemand" to solve this error.

Step:6  Goto process now you can see your selected added with name embedded with profiled.


Step:7 Thats it.Now you can trigger the workflow.

Step:8 Once you triggered the workflow. Go to "plugin profiles" and open relevant plugin record.

Step:9 Click on the “Serialized Profile” tab and copy the value specified in the “Serialized Profile”
.
Step 10. Create a new text file and copy the “Serialized Profile” value into it and then save the file.
Step 11. Go back to the Plugin Registration Tool, select the profile created earlier and click on the Debug button.

Step 12 In the opened Debug window, select the newly created text file in the Profile Location field and the Custom Workflow Activity assembly in the Workflow Activity field.

Step 13 Open your Custom Workflow Activity project using Visual Studio.

Step 14 Put the break point in your code and attach the debugger to the Plugin Registration Tool process and click the Start Execution button in the Plugin Registration Tool debug window.

The below steps are how to trigger the "OnDemand" workflow in the CRM

Step:1 Open any entity click "Run workflow"

Step:2 Select your custom workflow and click add now workflow get trigger






22 comments:

  1. Hi Alagunellaikumar,
    I need to debug my custom workflow and I am following your blog. Can you please clear me the line "select the newly created text file in the Profile Location field" in Step 15... I didn't get which text file are you saying about.
    ... with Best Regards

    ReplyDelete
  2. Hi Alagunellaikumar,
    Many thanks for updating your blog. It worked for me. I was facing some problem with the debugging, and but now I am able to perform my job. It will prove very helpful for me.
    Many thanks once again.
    All the Best!!

    ReplyDelete
  3. Could you please let me know how to stop the profile

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. There is an option called Stop profiling in the plugin registration tool.

      Delete
    3. I can't see the Stop Profiling option for Workflows. I have used this often for Plugins, but I can't work out how to stop profiling for workflows.

      Delete
  4. Hi,
    Though I placed the Custom Workflow Step in CRM, I still dont see it. My workflow is real-time workflow and it is not on-demand.
    Could you please help me out

    ReplyDelete
    Replies
    1. Have you registered the custom workflow in the plugin registration tool and also check it must be enable state.If you have still facing issue explain it detail.

      Delete
    2. I am also getting the same issue. Custom workflow steps are not listed in drop down in Profile Workflow.

      Delete
  5. I can't see any custom workflow steps in the drop down list to select can you help me

    ReplyDelete
    Replies
    1. Did you import it in CRM using plugin registration tool?

      Delete
    2. I found custom workflow steps only appear if they have been given a description in the workflow editor. If it still says 'Add your description here' in the step definition it will not appear!

      Delete
  6. Brilliant, thanks for posting

    ReplyDelete
    Replies
    1. Hi Alagunellaikumar,

      in CRM 2011, On-premise

      I have tried as you explained but the Custom workflow is not either failed or succeed.

      if I check the workflow ,the status shows "Waiting"

      also I am not able to find any "Plugin - Profile" records

      Do you have any idea

      Thanks
      Sam

      Delete
  7. I have CRM 2016 Online, and this doesn't work for me - When I try to click on OK button in "Profile Workflow" settings window, it gives me an error saying "Object reference not found"

    ReplyDelete
  8. Hi Alagu
    I am not able understand on-premises dubbing. May you explain more on it?
    Thank You

    ReplyDelete
  9. Hi, Nice article, thanks for detailed steps. I am having issue in step 3 and you have mentioned I cannot see the steps. So as per your advice, I am trying to troubleshoot it. I have confirmed that Custom Workflow Activity which I wanted to debug is already being used in Workflow Process, but still do not show up in Debug profiler.

    Can you please elaborate what exactly you mean by "If steps is not populate then you have to use your custom workflow in the CRM and come again and do it. "

    Appreciate your response.

    ReplyDelete
  10. Great write up. I'm using CRM 2016 and do not see where the "plugin profile" is located in CRM. Any help is appreciated. Thanks.

    ReplyDelete
  11. Great work. You have written really great content.Kik for PC

    ReplyDelete
  12. This is really great write up. Very easily understandable.Download IMO for PC

    ReplyDelete
  13. I think you have a great article here, But let me share with you all here about my experience with a loan lender called Benjamin Lee who helped me expand my business with his loan company that offered me a loan amount of 600,000.00 USD which I used to upgrade my business months ago. He was really awesome working with him because he a Gentle man with a good heart, a man who can listen to your heart beat and tell you that everything will be OK, when I contacted Mr lee it was on my Facebook page that his advert came up then I visited his office at Michigan to discuss about the loan offer that he and his company render, He makes me understand how all process go then I decided to give a try to it was successful just like he promised, yeah I believe him, I trust him, I rely on him as well about all my project he will be my dear financial officer and I'm glad my business is probably going well and I'm going makes my business growth like grass with his help.he work's with a great investors and guess what? They also give international loans. Is that not awesome to hear when you know a lot of business project are growing up each day by day in your heart hoping that you going to make income of that job to raise money for the project, Ops, then Mr Lee will help you with that, Yes international loan he will help you with that perfectly because I trust him very much for that kind of job, Look don't be shy or shaded give a possible try to Mr lee here his contact : 247officedept@gmail.com

    ReplyDelete

Note: Only a member of this blog may post a comment.