1

I am using sp2013. I have created a workflow with 3 "approval processes" activities. The first one needs to be approved. After this the second approval task needs to be approved. And at the end there is a last approval task which needs to be approved. After this I check the value of this task and try to change the approval status to "Approved". I got some error that the item needs to be checked out.

I added a activity to check out the item. But this gives an error. My version settings on my library are as follow:

enter image description here

ULS Error:

System.Workflow.Runtime.Hosting.PersistenceException: U kunt deze actie niet uitvoeren voor een uitgecheckt document. ---> Microsoft.SharePoint.SPException: U kunt deze actie niet uitvoeren voor een uitgecheckt document. at Microsoft.SharePoint.SPListItem.SetRequiredInfoForUpdateItem(Boolean bDocLib, Boolean bAdd, Boolean bMigrate) at Microsoft.SharePoint.SPListItem.PrepareItemForUpdate(SPWeb web, Boolean bMigration, Boolean& bAdd, Boolean& bPublish, Object& objAttachmentNames, Object& objAttachmentContents) at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion) at Microsoft.SharePoint.SPListItem.Update() at Microsoft.SharePoint.Workflow.SPWinOEWSSService.CommitUpdateDocument(Transaction txn, Object[] transData) at Microsoft.SharePoint.Workflow.SPPendingWorkBatch.Commit(Transaction transaction, ICollection items) at System.Workflow.Runtime.WorkBatch.PendingWorkCollection.Commit(Transaction transaction) at System.Workflow.Runtime.WorkBatch.Commit(Transaction transaction)
at System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService.CommitWorkBatch(CommitWorkBatchCallback commitWorkBatchCallback) at System.Workflow.Runtime.Hosting.DefaultWorkflowCommitWorkBatchService.CommitWorkBatch(CommitWorkBatchCallback commitWorkBatchCallback) at System.Workflow.Runtime.WorkflowExecutor.CommitTransaction(Activity activityContext) at System.Workflow.Runtime.WorkflowExecutor.Persist(Activity dynamicActivity, Boolean unlock, Boolean needsCompensation) - -- End of inner exception stack trace --- at System.Workflow.Runtime.WorkflowExecutor.Persist(Activity dynamicActivity, Boolean unlock, Boolean needsCompensation) at System.Workflow.Runtime.WorkflowExecutor.System.Workflow.ComponentModel.IWorkflowCoreRuntime.PersistInstanceState(Activity activity) at System.Workflow.ComponentModel.Activity.MarkClosed() at System.Workflow.ComponentModel.Activity.ReleaseLockOnStatusChange(IActivityEventListener1 eventListener) at System.Workflow.ComponentModel.FaultAndCancellationHandlingFilter.SafeReleaseLockOnStatusChange(ActivityExecutionContext context) at System.Workflow.ComponentModel.FaultAndCancellationHandlingFilter.OnEvent(Object sender, ActivityExecutionStatusChangedEventArgs e) at System.Workflow.ComponentModel.ActivityExecutorDelegateInfo1.ActivityExecutorDelegateOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime) at System.Workflow.Runtime.Scheduler.Run()

I know the workaround to disable this option, but this needs to stay enabled:

Require documents to be checked out before they can be edited?

Can someone tell me how I can fix this problem?

3
  • 1
    I've been consulting on SharePoint for 5 years now, with hundreds of clients. Every single one has tried to convince me that "require checkout" was a mandatory function for them. It's not. Ask them why, and debunk any crap they throw at you about people interfering with each other. Remove content approval as well and build it into a workflow manually, the out of the box one just gets in the way. Half the time the draft versioning options are also being used incorrectly.
    – Aboba
    Commented Jun 23, 2014 at 15:31
  • I try to tell the end users to disable "require checkout". They dont want to listen to me. But how can I make my own approval workflow? I would like to have the same logic that people see only there own draft version. And other people dont see the draft version of other people. How can I implement this logic?
    – Ola
    Commented Jun 24, 2014 at 6:16
  • 1
    People only seeing their own drafts (besides admins) is a bad feature. It causes situations where two people are looking at different files but expecting the same. It also prevents authoring of the file while one person has made even the smallest of changes before it get approved again. Poor business processes are usually to blame for this requirement, work with them to assess how the staff work on files and when approvals are actually needed. If it's a publishing type scenario, store the working copies elsewhere and have them push to the live area upon major changes only.
    – Aboba
    Commented Jun 24, 2014 at 13:37

3 Answers 3

1

If you only want to start an approval process for a document and change the approval status after the approval status completes, you can create an approval workflow in browser instead. When using the workflow created in browser, you can check 'Enable content approval'. In this way the workflow will Update the approval status after the workflow is completed. And the workflow can update the approval status without check out the document, which means you can leave the 'Require document to be checked out before they can be edited' to Yes.

http://social.msdn.microsoft.com/Forums/sharepoint/en-US/4e623ab1-ec84-45ed-8d8f-48849d6819a5/set-document-approval-status-within-approval-workflow?forum=sharepointgeneralprevious

1
  • Is it possible to assign the first task to userA, the second to userB and the last to userC? Not parallel, but one after one?
    – Ola
    Commented Jun 25, 2014 at 7:37
0

Have you tried to activate the Workflows can use app permissions Site Feature? It might get you around the problem since it allows the workflow elevated permissions. Here is an article about it. http://msdn.microsoft.com/en-us/library/office/jj822159(v=office.15).aspx

2
  • But is this combination of settings not working OOTB? I only see forums/topics where people have the same problem, but I dont see that this functionality combination is not working.
    – Ola
    Commented Jun 24, 2014 at 6:14
  • Workflows run at the permission level of the user who activated it, unless you elevate the permission. See the section "Understanding How it works" in post above. If the user who activates the workflow does not have permission (e.g. to check out/check in a document) to an element that the workflow touches you will get errors. Unfortunately the errors aren't always helpful. Activating the Workflow site feature has solved many of those problems for us. You will need to evaluate that, every SP deployment is different. We have successfully had a WF check in/out documents in our environment. Commented Jun 25, 2014 at 15:37
0

when updating multiple fields this error occures.

as you noted you gave your own answer! within the workflow the first action would be to set the check out action on the item.... do the updates on the list item (actions) and then set the check in action on the item workflow! you need to wrap the workflow actions with the check-out and check-in actions so that any workflow action be available for all the updates on the list item.

second solution would be to ask all users to check out the document before you start the workflow on that item, once workflow is done you can check it back in!

thrid solution would be to follow this:

Assuming the workflow is a SharePoint Designer Workflow, Open SharePoint Designer and Connect to your site. Click on Workflows from the left navigation, and click on your workflow. Workflow information page will open. In the "Settings" area in the right pane, uncheck the "Automatically update the workflow status to the current stage name". This will fix the problem.

https://stackoverflow.com/questions/17222287/sharepoint-2013-workflow-not-firing-when-document-checked-in-but-works-if-checke

EDIT

looks like your answers here:

What I suggest is set the 'Set Require document to be checked out before they can be edited’ to ‘No' for the entire library. Then the workflow can edit the approval status for the documents.

If you only want to start an approval process for a document and change the approval status after the approval status completes, you can create an approval workflow in browser instead. When using the workflow created in browser, you can check 'Enable content approval'. In this way the workflow will Update the approval status after the workflow is completed. And the workflow can update the approval status without check out the document, which means you can leave the 'Require document to be checked out before they can be edited' to Yes.

http://social.technet.microsoft.com/Forums/sharepoint/en-US/4e623ab1-ec84-45ed-8d8f-48849d6819a5/set-document-approval-status-within-approval-workflow

1
  • just noticed that you are checking out the item within the workflow! but your getting: You can not perform this action on a checked out document. where within the workflow is this occuring? on the first stage approval? is there custom code?
    – Ali Jafer
    Commented Jun 26, 2014 at 10:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.