How to prevent user from editing list item if the workflow is still running?

  • 16 September 2015
  • 8 replies
  • 14 views

Badge +2

I have an issue where a user creates a list item, and at the same time he is editing the same item before the workflow on initial item creation is completed. The workflow then gets cancelled do to the error. Is there a way you can prevent user from editing the list item until workflow completes or not to redirect to all items page until workflow has been completed?

This is the error email that the user gets:

The wrkfl_AudiologyDeviceOrder workflow has ended unexpectedly for Mike Jenkins.

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

Thanks, Denis


8 replies

Badge

You can check the status for that item's workflow is completed or not on Edit mode. If its not completed, dont allow!

On you list there will be a field at the end which shows your workflow status, I think you can use that!

On you form, try adding a variable which can decide based on your workflow field value and using that variable alert the user through Javascript on document ready function on edit mode.

Badge +2

Is there a way to wait for the workflow to finish before the all items page is displayed and refreshed? That way user won't be able to get to the list item until workflow is completed and at the same time columns on all items page will be updated with most recent information that is used in a workflow.

Badge +2

Is there a way to wait for the workflow to finish before the all items page is displayed and refreshed? That way user won't be able to get to the list item until workflow is completed and at the same time columns on all items page will be updated with most recent information that is used in a workflow.

Badge +11

You can change permissions at the beginning of the workflow so that owners are the only ones who can edit the item. If you have no access, you can't even see the items.That will prevent owners being able to get access in case something goes wrong. At the end of the workflow, set the permissions back to the proper users.

Badge +2

(if using SharePoint 2013, you can use Client Side Rendering, otherwise XSLT)? What do you mean?

Badge +6

As suggested by others, you may want to remove all permissions but the users when the workflow starts. The problem with removing initiators permissions at start is that you may run into Access Denied error, or the one you specified above where a column update fails.

Badge +16

‌ did you resolve this in the end?  which approach did you take?

Userlevel 2
Badge +11

If the user opens the submitted item from the list view after creation, you could filter the view(s) to only show items with workflow status Completed or Canceled (or not In Progress). This way the item becomes visible after the creation workflow has completed or was canceled.

Reply