Steps to enable Server Side Tracing

March 27, 2017

Blogger Image

Bhavik Vyas

Senior Technical Lead

Steps to enable Server Side Tracing

  1. Navigate to Settings > Administration > System Settings > Customization Tab What if CRM workflow fails
  2. Click on “All” in the Enable logging to plug-in \ custom workflow trace log dropdown to enable tracing service.
  3. The trace will be downloaded/located in Traces folder of Microsoft Dynamics installation folder. By default, the folder will be located in C:\Program Files\Microsoft Dynamics CRM\Trace. (On-Premise)
  4. The error log files will look as mentioned below.
    What if CRM workflow fails

For an Asynchronous registered custom workflow activity returning an exception, the tracing viewed will be as below.(Online)

Steps to Open Error log in custom workflow activity:

  1. Go to Advanced find and select System Jobs option in the ‘Look for’ Dropdown
    What if CRM workflow fails
  2. Click on results and select Workflow related logs in the system jobs name column displayed as shown below.
    What if CRM workflow fails
  3. Example of a Custom Workflow code which will throw exception while updating the service record as Invoice object is not initialized.
    What if CRM workflow fails
  4. Double click on the workflow which needs to be traced in the system jobs page, a pop-up window will open as shown below.
    What if CRM workflow fails
  5. The following exception will be thrown in the Error Stack trace when the above code is executed.
Plugin Trace:
[GS1.CRM.Workflows.InvoiceProcessing: GS1.CRM.Workflows.InvoiceProcessing.InvoiceRemainder.InvoiceRemainder]
[Invoice: InvoiceRemainder]
Entered InvoiceRemainder.Execute(), Activity Instance Id: 1, Workflow Instance Id: 456fc565-cadc-42fd-9242-7ddcf654ad0d
InvoiceRemainder.Execute(), Correlation Id: d6369603-801e-405e-b162-6a158fcb42b2, Initiating User: 8cf5c01e-42cc-e211-9081-00155d517828
Error Message:
Unhandled Exception: Microsoft.Crm.CrmException: Unexpected exception from plug-in (Execute): GS1.CRM.Workflows.InvoiceProcessing.InvoiceRemainder.InvoiceRemainder: System.ArgumentNullException: Value cannot be null.
Parameter name: value
   at Microsoft.Crm.Sandbox.SandboxCodeUnit.Execute(IExecutionContext context)
   at Microsoft.Crm.Workflow.Services.ProxyCustomActivity.Execute(CodeActivityContext executionContext)

For the most part, workflows are asynchronous. However, if you have synchronous workflow along with custom workflow activity, it can return an exception to the platform in an error dialog box in the web application as displayed below.

What if CRM workflow fails

User may select Download Log File button in the dialog to view the log containing exception and trace the output.

Be sure to turn off tracing once you have collected the information!

If you would like to know more about our MS Dynamics CRM Services, then do leave an enquiry with us here.

Join the conversation

What are your thoughts on this blog? Drop us a line below. We’d love to hear from you.

© 2017 Nous Infosystems Pvt. Ltd. All rights reserved.