cancel
Showing results for 
Search instead for 
Did you mean: 
dhalilov
Nintex Newbie

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

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

0 Kudos
Reply
10 Replies
Not applicable

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

You could check out the item or change the permissions at the start of your workflow (you may have to throw in a "Commit Pending Changes" action as well), then at the end of your workflow check it back in/reset the permissions.

Reply
sukeshm7677
Nintex Newbie

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

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.

Reply
dhalilov
Nintex Newbie

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

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.

0 Kudos
Reply
dhalilov
Nintex Newbie

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

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.

0 Kudos
Reply
burkslm
Nintex Newbie

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

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.

Reply
Not applicable

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

Like Sukesh suggested, you might be able to use some Javascript on the edit form to prevent it from returning the user to the list view page straight away and do some checks for the workflow field value. This won't prevent them from just navigating straight to the list view page.

The simplest thing will be to set item permissions so that the user can only read the item, or not see it at all. Something to be aware of though is that if you do remove the user's permissions in the workflow, you will need to make sure the workflow still has permission to update the item/set the permissions. In cases like this, I usually use an "Action Set" action and set the "Run as workflow owner" flag in the action set options. Then put your "Update list item" actions and the "set permission" action within that action set. This works well if the workflow owner (the person who published the workflow) is a site collection administrator.

Additionally (outside of the scope of Nintex Workflow), if you do use the permissions option, you could make it more obvious to your users that the workflow is still running by formatting the list item in such away that communicates that the workflow is still running (if using SharePoint 2013, you can use Client Side Rendering, otherwise XSLT).

Reply
dhalilov
Nintex Newbie

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

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

0 Kudos
Reply
tapologo
Nintex Newbie

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

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.

0 Kudos
Reply
Automation Master
Automation Master

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

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

0 Kudos
Reply