SharePoint designer 2010 Workflow Error Handling

Posted April 1st, 2014 by Panda

As I continue to work in SharePoint 2010 and enhancing our corporate Intranet, I’m getting more creative with my basic workflows built out of SharePoint designer. And as workflow logic complexity increases, it also becomes more error prone. Besides creating lots of extra log entries scattered throughout my workflows, I stumbled upon a clever idea to get alerted when an error occurs.

In a nutshell, what it involves is creating an alert based on a workflow status. When a workflow is created, a new column is created that allows you to monitor a workflow’s status. While the default display of this column is a link to the workflow status page (also where you can find the log entries), the workflow status also corresponds to a numerical Event Type code. Build an alert based on that error code and voila! You’ll get notified when an error occurs!

Here’s a recipe for how to get alerts on event errors:

  1. On any SP list with a workflow, create a new calculated column.
    1. Name: IsError (or something meaningful)
    2. Formula: =OR([Event Type]=0,[Event Type]=10)
    3. Data Type: Yes/No
  2. Create a new view (e.g. Workflow Errors) that contains this column (You’ll need this to create an alert based on the view, and avoid exposing this to end users)
  3. After the view is created, be sure to navigate back to that view of the list, and create an alert by clicking the “Alert Me” button in the ribbon. Use the following settings:
    1. Change Type: choose the change type that correspond with how the WF is initiated (e.g. if the WF only fires when new items are created, so should your alert).
    2. Send Alerts for These Changes: choose the last option, “Someone changes an item that appears in the following view” and choose the view you just created in the dropdown.
  4. When to send alerts: choose the frequency that suits you.

That it! This is just a basic recipe, but you can change the ingredients how you like.

Sources:

Comments are closed.