Nebulae Spiral

Spiralling Golden… and maybe blogging about code.

Archive for the ‘worklow’ tag

Save Conflict in workflow on SPListItem.Update or SystemUpdate

with one comment

in this scenario, I have a really simple workflow that creates a task, does some infopath approval stuff, then copies that list item to another list. the kicker is when you want to add something about that copied item to the original item, say an id column so you have a reference. after saving the copy, you set a column on the original and try to update the listitem, and get a “save conflict” error.

Ive seen a lot of posts on this error, most of them point to not having access to that listitem because its locked by the workflow itself. I would assume that you can somehow capture the item before the workflow updates it, and set the properties you want. could someone enlighten me if this is true? I’ve seen posts saying to use a delay, to wrap it in a repeating try / catch until the item is unlocked, to try programmatically to check it out, and then save it. I can’t see any of this as being best answer.

What Ive decided is to attach an event handler to the second list to set the id in the first. this seems to be pretty reliable, plus I already had an event handler on that list. I’m really curious to know if there’s a resolution for this.

other info on this issue:
http://forums.msdn.microsoft.com/en-US/sharepointdevelopment/thread/641b40fb-614f-4266-95c0-d61c2f443146/

Written by Nebulae

August 1st, 2008 at 2:16 am

Posted in code

Tagged with , , ,