Error on document checkin

  • 22 September 2014
  • 3 replies
  • 15 views

Userlevel 4
Badge +12

I'm running a Nintex workflows 2013 workflow on a pages library. After a check in process the workflow calculates some things and is supposed to update the element again.

I have workflow actions to check the item out, update a field (single line of text) and check in the page afterwards.

 

If I run the action in 80% of my test runs I get the following error:

The workflow could not update the item, possibly because one or more columns for the item require a different type of information.

 

However, if I put a "Wait for 1 minute" action before the check in action, the workflow always runs fine.

 

I can only assume that the workflow wants to check in the document too early and not waits until the database was updated with my field value. As I don't want to spread waiting actions I wonder if there is any way to wait for the DB-operation to commit before checking in the document.


3 replies

Userlevel 7
Badge +17

A commit pending actions could be the exact thing you need. This is a common occurrence and the item needs to complete updating before the check in is successful. SharePoint needs to complete its batch of updates before the check in and a "Commit Pending Changes" forces the batch to commit. But, what I wanted to add is that sometimes the wait is required to guarantee that the commit is completed. For example, I have several workflows that change the permission to the item and then check it in. The commit action will force the permission change to take place before my check in, but the majority of the time SharePoint has not completed the activity in the milliseconds between the actions and before the check in. Adding a Wait always solved this issue for me in various client environments.

There are other possible ways to design a workflow to combat this. You could have updates running in parallel to have all committed near the same time, then do the check in. If you are updating several items in a loop you can loop around the updates, then outside the loop run a Commit, then a final loop to go back and check in all items using the same collection. You could have the primary workflow doing all the updates, then have it call a workflow that has one action that Checks In the current or specified item.

Userlevel 7
Badge +17

Adding a commit pending changes before an update can be helpful in some cases. Especially if there are updates that occur earlier in the workflow, including check-ins or permission changes. A commit will simply tell SharePoint to go ahead and complete all batches before doing the next one.

If you are getting an error that the data type is wrong, then I wouldn't quickly believe that it is a batch updating/commit issue. But by adding a commit, or a pause, would help to make sure the list item is in a place to update and all updates beforehand should be completed before the next. But usually a type error wouldn't be resolved by a commit if the data you are providing is a string and is expecting a string like you said.

Could it be that it is updating the list item with a null value instead?

Userlevel 7
Badge +17

I believe this could happen if the user uploads a document and does not check it in, and the document is a minor version document. In this case the document isn't officially version 0.1 until the user checks it in. SharePoint will not allow the workflow to run under that condition. Once the user checks in the document, even to a minor version, the workflow will start.

Some things you can do to change the behavior:

  • Not require check outs
  • change versioning settings
  • Review permission behavior (who can see minor versions, see only my documents, etc)
  • Update the Form and include a note about checking in documents
  • Go to library settings and select the link to Manage files which have no checked in version, and check them in or notify the creator.

Reply