Stump the Panel: SharePoint Q&A

Immediate solutions for common SharePoint questions
It is currently Sat Feb 11, 2012 10:27 pm

All times are UTC - 5 hours [ DST ]


Forum rules


What you are viewing is an archive of Stump the Panel. It remains for reference purposes. Please post all new questions on NothingButSharePoint.com
https://www.nothingbutsharepoint.com/sites/eusp/Forum



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: SPD 2007: Check out / in and error updating a list item
PostPosted: Thu Sep 02, 2010 4:19 pm 
Offline

Joined: Tue May 25, 2010 2:21 pm
Posts: 8
I have a SharePoint Designer 2007 workflow that is running from a library that requires check out.

The workflow runs as desired when Require Check Out is set to No. Of course, when I change Require Check Out I get the following error in the workflow history: Error updating a list item - Document must be checked out.

So, I added a step to the workflow to Check Out the Item, a step to pause for 5 minutes, [then the existing step to update the list item], and then added a step to check the item back in.

Now I am getting this error: Error updating a list item - Unknown error. This error is happening after the item is checked out (The item is checked out to whomever started the workflow - I think this might be the problem), but before the item is updated. The System Account is trying to update the item.

Is this happening because the item is checked out to the workflow owner so the system account can't update it? Either way, how do I fix this?

Thanks in advance for your time!
Erica


Top
 Profile  
 
 Post subject: Re: SPD 2007: Check out / in and error updating a list item
PostPosted: Thu Sep 02, 2010 11:20 pm 
Offline
User avatar

Joined: Thu Sep 02, 2010 11:02 pm
Posts: 2
Location: Chicago IL
Hi Erica!

I did a little research tonight and it seems that you're not alone with this error. I was able to find 4 good references on this exact problem (links below).

  • Do you have access to the server 12 logs? That will give the exact detail behind "unknown error" and help narrow it down better.
  • Are you using version history?
  • Are you using content approval? Going beyond just check-out these settings could be tripping it up too.

The 12 LOGs are under "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS" Try to find the most recent .LOG file and scroll down to the exact time when your workflow errored. (need to watch the clock earlier when kicking WF off) If your 12 .LOG line detail is Category=Workflow Infrastructure EventID=98d4 then the second link below where Shaun08 suggests using a prefix for the Update action. In this case the Update is on a Lookup field and it's having trouble finding the value (processing the lookup) so a "-1;#" forces the update to go. I don't know what field type you are updating.

I hope that helps, sorry I don't know exact what this one is but it does seem common. Please post back what you find out and maybe other STP people will contribute their thoughts. =)

http://social.msdn.microsoft.com/Forums/en/sharepointworkflow/thread/2c3ba1ad-d281-41ac-a78c-868b441241b9
http://social.msdn.microsoft.com/Forums/en-US/sharepointworkflow/thread/9410ed52-e68b-4f5f-8acf-1b90e01d8556

Best,
Jeff

@spjeff


Top
 Profile  
 
 Post subject: Re: SPD 2007: Check out / in and error updating a list item
PostPosted: Fri Sep 03, 2010 12:58 am 
Offline

Joined: Tue May 25, 2010 2:21 pm
Posts: 8
Thank you so much Jeff for your help here and on twitter. I will research tomorrow and report back. This provides some excellent leads!

- The list is using content approval
- The list is using versioning


Top
 Profile  
 
 Post subject: Re: SPD 2007: Check out / in and error updating a list item
PostPosted: Fri Sep 03, 2010 9:16 am 
Offline
User avatar

Joined: Thu Sep 02, 2010 11:02 pm
Posts: 2
Location: Chicago IL
Sure thing, glad to help. The combo of version history + content approval + check out may be part of it. Maybe the WF needs to "approve" the item before attempting to update it? Could try 2 updates steps (set approved / set value)?

Here are the other two links:

http://blog-sharepoint.blogspot.com/2010/02/sharepoint-workflow-errors-descriptions.html
http://connect.nintex.com/forums/thread/1826.aspx

phpBB limits us to only 2 web links per post and I forgot to copy/paste these back over.


Top
 Profile  
 
 Post subject: Re: SPD 2007: Check out / in and error updating a list item
PostPosted: Fri Sep 03, 2010 11:20 am 
Offline
User avatar

Joined: Fri Sep 03, 2010 10:44 am
Posts: 1
Location: Reston, VA
Hi Erica,

I passed your question around to some team members here and received the following response from Chris Lincoln as a potential solution (because there is not enough information to establish that it could be a definite solution).

Feel free to get in touch with any questions about the following, and we hope it helps.

Thanks,
The MetroStar Systems team


* * * * *

If a declarative workflow (i.e. SharePoint Designer 2007 workflow) (1) is attached to a Document Library that requires document check out and (2) is triggered upon item creation, the workflow will run while the Document is checked out. This often results in unspecific (read: misleading or inaccurate) workflow errors.


When a Document (i.e. List Item) is uploaded to a Document Library that requires document check out, the Item Created event is triggered and thus the declarative workflow is triggered. However, declarative workflows (even if running under the same account as the Checked Out To account) often run into errors updating a checked out List Item. Checking out a List Item while it is already checked out logically causes a workflow error.


Therefore, the resolution is to prevent the workflow from running while the List Item is still checked out (something that cannot be avoided due to default SharePoint behavior), check out the List Item (as it is required per List Settings), perform any desired update(s) to the List Item, and check in the Document (to commit the pending update(s) and allow other Users to work with the List Item).


The first step of any declarative workflow used in such a scenario should look something like:
* If Checked Out To is not empty
* Log Waiting for Document to be checked in. to the workflow history list
* then Wait for Checked Out To to be empty
* then Log Document checked in. Continuing workflow... to the workflow history list

Then, the List Item should be checked out by the declarative workflow. Using the default action Check Out Item will accomplish this.

Then, the workflow should update the List Item as desired.

Finally, the List Item should be checked in (by the declarative workflow or otherwise). Using the default action Check In Item will accomplish this.


* Please note that use of timed actions is highly discouraged unless required by some business rule. Use of the default action Pause For Duration ensures that the declarative workflow will have a significant minimum time to completion (i.e. every workflow in the described scenario would require at least 5 minutes to complete) and thus appropriate triggering of the declarative workflow may not be ensured. While a declarative workflow is In Progress, no other instances of the declarative workflow will be created.


** Also, If the declarative workflow is not attached to the Document Library, it will be unable to access the List Item even if it is responsible for the check out; the List Item will immediately become inaccessible to the declarative workflow (likely throwing an error relating to the List Item not existing).


*** Finally (for now), note that using the default action Check In Item will result in a major, rather than minor, version check in. This may be undesirable depending on the System design. If a minor version check in is required, please see below for a use case describing a solution. Unfortunately, I am unaware of a solution that does not require development.
1. User creates or modifies List Item (System begins declarative workflow at this time)
2. System navigates User to a redirection page
3. System checks the status of the workflow until the workflow status is not 2 ("In Progress")
(by either the SharePoint object model or web services (GetListItems method of the Lists web service))
4. System checks in the List Item
(again, by either the SharePoint object model or web services)
5. System navigates User to destination

For more information regarding workflow statuses, see David Wise's Sharepoint blog.

* * * * *


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group