Tuesday, 6 December 2011

Use “Check Out” and “Check In” actions with globally reusable workflows in SharePoint Designer 2010

I love that SharePoint Designer gives you the ability to create reusable workflows. It’s even better that you can select “All” as the content type. However, I have come across a minor issue with being able to update an item that requires check in and check out via workflow and being able to apply that to “any” list, content type, page or document. You can’t start a workflow on an item that’s checked out, but you can’t update an item that’s checked in. When you try to use the “Check out” action, you are expected to select a list to check out an item from.

The Requirement: Create a workflow that will make field updates to a document or page that requires check-in / check-out. This workflow must be able to work on any page or document library in the site collection.

The Problem

  1. I can’t update any old field on a checked-in item housed in a library where check-out is required.
  2. SharePoint Designer workflow action “Check out item” wants me to choose a List Item to check out, but I need to be able to use this on any list or content type.

The Solution: a modification to the .xoml file that tells the workflow to use “this item” regardless of the list.

Disclaimer: If you want to model an out of the box workflow, always copy and modify…it is never a good idea to modify the out of the box global workflows directly.


  1. Set up your workflow with placeholders for your check-in and check-out actions.
  2. Add “Check out item in this list” and “Check in item in this list with Comment” actions to the appropriate steps on your workflow. a.
    • Do not select a List. Leave the “this list” as is 
  3. Save your workflow.
  4. Go “All Files”, “Workflows”, click on the workflow name in the window below “All files” so that your workflow displays it’s files in the window on the right side of the screen.
  5. Right click on the .xoml file and click “Open With”, “SharePoint Designer (open as XML)”
  6. Click Ctrl+F to find “CheckOutItemActivity”
  7. In that row you will see: ListItem={x:Null}” ListID=”{x:Null}”
  8. Replace “x:Null” in “ListItem=” with “ActivityBind ROOT, Path=__item”
  9. Replace “x:Null” in “ListId=” with ActivityBindROOT, Path=__list”
  10. Click “Ctrl+F” to find “CheckInItemActivity”
  11. Repeat steps 8 and 9 for this line item.
  12. Save this file.
  13. Click on “Workflows” and click on the workflow name to open the workflow file as you normally would.
  14. Do not make any changes but click “Save”
  15. When Designer pops up to say that a different version of the .xoml file was saved, and politely asks if you want to replace that file with this one click “No”.
  16. Close Designer and re-open it
  17. Click on “Workflows” and click on your workflow to open and edit it.
  18. Find the step where you checked out and checked in the item.
  19. The action should say “Check out item in Current Item” and “Check in item in Current Item with comment: xxx”

I’m not sure why you have to close Designer and re-open it before you can see your changes, maybe it’s just my wonky machine, but I have to follow these steps exactly on order for the change to “take”.

Note:  Make sure that you do NOT have “end on change” feature turned on, or your workflow will stop immediately after making the change without checking the document back in.