Tuesday, 27 September 2011

SharePoint Designer 2007 Workflows Are Not Portable. At All. No Matter What It Says.

SharePoint Designer lied to me last week. I had a SharePoint list on a site and the user of the site wanted to rename the library upon which I had compiled the workflow. In Designer, you have the ability to create workflow on a list - a bit like event handlers but without code involved - and I went in to have a look at the one I'd just made. On the first screen, where it says the List Name, it appeared that it had changed the name in the workflow just as the user had on the site. I opened it and clicked Finish to re-run it. No errors. Happy days, everything was working fine.

Until I got an email saying it wasn't working. Cue much embarrassment on my part, apologies, and then the one thing I had thought I might avoid - deleting the workflow and recreating it all over again. But really the take home message from this experience is this:

Whenever you need to move or alter a workflow in Sharepoint Designer 2007 because of a change to the site or list, you need to recreate it again from scratch.

This is because Sharepoint Designer retains a hard-coded memory of those blasted GUIDs. You can never use the workflow for any other list, you can't move it anywhere, and as I have just learned, you can't rename the list. Oh and forget trying to wrap it up in a template file in .stp format - it won't work.

And it won't bother giving any errors. Errors are for wimps.

The second take-home message would be - Whenever you regenerate the workflow, create a new item on the new list. Yes, even if the list is "live". You can always delete it. Just don't trust Sharepoint Designer 2007 to tell you anything!

No comments:

Post a Comment