Skip to main content

Workflow Debugging - CRM 4.0 vs CRM 2011

In CRM 4.0 debugging workflow errors can be a pain.  If you browse to the system job record, it is in either "Waiting" or "Failed" status.  Opening the record in hopes to find more details just provides you with the infamous generic error "An error has occurred.".  A pro tip if you are in this situation is to run this SQL query against the organization database:


select Message from AsyncOperationBase
order by CreatedOn desc

This will display all the system job records in order of most recent.  The Message column will contain a more detailed error which is very helpful in troubleshooting the workflow instead of the generic error you see in the UI.

For example I have a workflow that executes on status change of a Task and the workflow will try to update that Task record.  When I close a task this workflow will execute and fail.  I can dig into the database by running the SQL query from above to find this very helpful message:


This tells me exactly what the problem is without having to troubleshoot blindly.  Since my Task is being closed it kicks off my workflow which tries to update the Task record but the Task record is in Closed state so therefore it cannot be updated.

In CRM 2011 Microsoft provides us with a nice UI on the system job record that tells us exactly what the error is and also provides the full stack trace in the Details tab.


Comments

  1. very nice observation.
    at least the 4.0 exercise is healpful :P

    ReplyDelete
  2. hi,

    instead of going db, u can get the "message" from the advance find and edit the view by adding the column...
    so better use the advanced find, as the column is exposued for use...

    ReplyDelete

Post a Comment

Popular posts from this blog

Announcing the New Dynamics 365 Toolbot Chrome Extension!

Today I am excited to announce the new Dynamics 365 Toolbot! This new Chrome Extension will allow you to perform commands that will help you with your development or administrative tasks. The extension can be found here - https://chrome.google.com/webstore/detail/dynamics-365-toolbot/kljiiminicfmdlplhejocopfmgmipach.

Note: Currently, due to the APIs being used, it only works on v9+.

First, navigate to the link above using Chrome and install the extension. Then, head to your Dynamics 365 environment and open a record. From there, click the little blue robot icon in the toolbar of Chrome which will pop open the Toolbot.



Click the text box and a list of commands will display. You can select or type any of the commands and hit Submit to execute them. Some commands require you to replace the default token with the desired request.


For example, select or type "display id" and click Submit and the Toolbot will display the current record's ID.



The majority of the commands should …

Dynamics 365 ToolBot: Auto-populate the form

Today I released a new command for the Dynamics 365 ToolBot that I am really excited about! If you're not sure what the Dynamics 365 ToolBot is, it is a new Chrome extension that I released recently that allows you to quickly execute helpful commands for administrators, developers and testers.

This new command, called "Fill Form", will automatically populate all the fields on the form with random data. As a developer, I always need test data and I am the worst at coming up with fake data to use. With this command, you can navigate to any record, open the ToolBot, type "Fill Form" and your record will instantly be populated with random data so you can quickly save the record and proceed with your testing.


A few things to note about this command:
It attempts to detect contact fields (based on the field name) such as first name, last name, email, phone and address and populate those fields with realistic fake dataAny other field will generate random data based on t…

Introducing the new WYSIWYG model-driven form designer

Microsoft recently announce their new WYSIWYG model-driven form designer.  See here for more details.

Initially looking at this, this designer seems pretty amazing and will resolve a lot of the pain points identified with using the classic Dynamics 365 form designer, such as:

Allowing makers to see how the form would look to end users as they configureEnhanced fields pane with searching and filtering capabilities on the leftAn always available properties pane allowing makers to configure components of the form without having pop-ups appearA tree view to quickly navigate forms fields and controlsThe ability to switch between form factors / sizes to see how the form will look on different devicesSave and publish via a single button

To use the new form designer, you must click on either Edit form (preview) or Add Form -> Main form (preview) from PowerApps.
Note that this is currently out only in public preview, and therefore consider this a very early version of something exciting to c…