SharePoint 2010 List workflow status – unexpected error

Problem

When you remove a workflow from a list without first terminating any workflows in progress. You will be in for a surprise when you try to check the workflow status of any item that has an association to the workflow you are deleting.

SharePoint will tell you that an ‘unexpected error has occurred’. But if you delve deeper using ULS Viewer, you will notice the the following error

System.ArgumentException: Column ‘ColumnName’ does not exist. It may have been deleted by another user.  /path/to/library

Cause

Every workflow that has run before is associated with a hidden field/column in SharePoint. The workflow status page of each item references this field using its StaticName. This StaticName is the name that is referenced in the ‘ColumnName’ quoted above. When you remove a workflow from a list, you also remove this column.

To get the StaticName of the field, you can use SharePoint Manager 2010 and browse its properties.

Solution

This is not really a solution, but a work-around. In my testing, I have not been able to completely get rid of old workflows that already had items associated to it. If you have broken your list, then this is what you must do, provided you have not deleted the workflow from SharePoint designer.

  1. Open your list -> List Settings -> Workflows -> Remove Workflows
  2. Remove the workflow and any previous versions if you have not already done so.
  3. Republish your workflow from SPD.
  4. Create a new item, and run the workflow manually. This will create the missing column.
  5. Open SharePoint Manager 2010 and browse to the column, check that the static name matches the missing column name from the ULS log.
  6. Open the workflow status page of an existing item.

Note

If you remove a ‘previous version’ workflow that has no items ‘in progress’, you will not have any problems as the workflow column will not get deleted. However, if you remove it with workflows ‘in progress’. You will break it and will have to remove ALL versions of the workflow and then re-publish from SharePoint Designer.

 

 

 

 

Tags: , ,

3 Responses to “SharePoint 2010 List workflow status – unexpected error”

  1. Chuck November 2, 2011 at 5:37 am #

    Thank you!

  2. wetriver January 12, 2012 at 12:14 pm #

    Thanks – worked like a charm!

  3. Stefan August 14, 2015 at 8:24 pm #

    Thanks – worked great!

Leave a Reply

%d bloggers like this: