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