none
The workflow operation failed because the action requires the document to be checked out RRS feed

  • Question

  • I'm a new Site Administrator for a SharePoint 2010 Team Site. I created a workflow in SPD called Populate Title.  If the title of a document is empty, it is supposed to populate the title field with the name of the file, and write "Title changed to file name" to the log.  It works fine as long as "Require documents to be checked out before they can be edited" is not enabled.  The workflow is set to start when an item is created. If require documents to be checked out is enabled, it cancels the workflow. This is the error message in the history log.  "The workflow operation failed because the action requires the document to be checked out". The history log shows system account as the user id when this happens. How can I get this workflow to work with the require checkout before edit option turned on? Thanks.

    Thursday, May 26, 2011 9:32 PM

Answers

  • No, that is not correct.  The workflow MUST check the file in.  It's just another step just like checking it out - add it to the end of the workflow.

    Also, you have no need for a Wait step.  Workflows cannot fire on a item that is checked out anyway.

    If you have your answer, then please mark it as such.  Thanks!


    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force
    • Marked as answer by dhodges Friday, May 27, 2011 2:53 PM
    Friday, May 27, 2011 2:28 PM
  • Yes, I see what you mean.  After checking in or saving the document for the first time, the workflow now runs perfectly. This is how I modified it:

    Step 1

    If CurrentItem:Title is empty

    Check out item in CurrentItem

    then Set Title to CurrentItem:Name

    then Log Title changed to file name to the workflow history list

    then Check in item in CurrentItem with comment: Title changed to file name.

    Thanks again for your guidance with this.  I will mark the post as answered.

    • Marked as answer by dhodges Friday, May 27, 2011 3:00 PM
    Friday, May 27, 2011 2:59 PM

All replies

  • By checking out the document in the workflow before updating it.  It's doing exactly what you're telling it to.  It requires check-out, so it will not let you update the file without checking it out first.  You then should check it back in after updating the Title.  Makes sense, yah?
    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force
    Friday, May 27, 2011 12:52 AM
  • Thank you for your reply.  With your help I was able to solve the problem with the workflow!  Thank you so much!  Since "require checkout before edit" was already enabled on the Document Library, when uploading a document for the first time, the system displayed this message: "The document was uploaded successfully and is checked out to you. Check that the fields below are correct and that all required fields are filled out. The file will not be accessible to other users until you check in." Changing the actions in Step 1 fixed the problem.  The document remains checked out, but that's what the user gets for not giving the document a title.

    Step 1

    Wait for document to be checked in

    If CurrentItem:Title is empty

    Check out item in CurrentItem

    then Set Title to CurrentItem:Name

    then Log Title changed to file name to the workflow history list

    Thanks again!

     

    Friday, May 27, 2011 2:23 PM
  • No, that is not correct.  The workflow MUST check the file in.  It's just another step just like checking it out - add it to the end of the workflow.

    Also, you have no need for a Wait step.  Workflows cannot fire on a item that is checked out anyway.

    If you have your answer, then please mark it as such.  Thanks!


    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force
    • Marked as answer by dhodges Friday, May 27, 2011 2:53 PM
    Friday, May 27, 2011 2:28 PM
  • Yes, I see what you mean.  After checking in or saving the document for the first time, the workflow now runs perfectly. This is how I modified it:

    Step 1

    If CurrentItem:Title is empty

    Check out item in CurrentItem

    then Set Title to CurrentItem:Name

    then Log Title changed to file name to the workflow history list

    then Check in item in CurrentItem with comment: Title changed to file name.

    Thanks again for your guidance with this.  I will mark the post as answered.

    • Marked as answer by dhodges Friday, May 27, 2011 3:00 PM
    Friday, May 27, 2011 2:59 PM
  • That is definitely correct now.
    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force
    Friday, May 27, 2011 10:06 PM