cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

how to locked and give a warning to user when they edit the form but already open by another user

hi, 

 

i'm new using nintex form and workflow.Is there a way to locked the edit form and give warning for a list item if another user already open the form? 

 

thank you,

pandan 

Labels: (2)
0 Kudos
Reply
4 Replies
Workflow Hero

Re: how to locked and give a warning to user when they edit the form but already open by another use

Out-Of-The-Box this is not possible. SharePoint does not offer such a locking-mechanism, and Nintex Forms has no additional feature in this regard.

You could however try to achieve something like this with the magic of JavaScript.

 

You could create a SharePoint-List to hold locking-informations. Whenever someone opens a form you query this list if the current item is already "locked" by someone else. If yes, you display a message to the user and redirect the user to the display-form of the current item.

If the current item is not in the locking-list, you will insert a new record into the list. The list should contain the listname as well as the item-id. Since the list is populated via JavaScript you'll get the owner of the lock "for free", because you can just look at the creator of the entry.

 

However: you will also have to add some script to be executed when the current item is either saved or canceled. In this case you would have to remove the entry for the current item from the list.

 

As a bonus you might want to check the age of the entry when loading a form. If the entry is older than a certain threshold you could consider this entry to be stale and delete the record and create a new record.

 

I've created such a mechanism prio for a customer (although not within Nintex Forms, but that doesn't matter in this context). I have to point out: this is not a fool-proof approach! Someone could still modify entries using the SharePoint API (SSOM, CSOM, JSOM, SOAP, REST) without any locks!

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: how to locked and give a warning to user when they edit the form but already open by another use

Check out my reply to a similar question.

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: how to locked and give a warning to user when they edit the form but already open by another use

Hi Eiben, 

 

thank you for your reply. 

have you ever tried that one? if yes, can you give the procedure how to do that? or the link?

i already try this one https://www.c-sharpcorner.com/UploadFile/0e18a8/check-in-and-check-out-functionality-for-custom-list... but doesn't work. 

 

 

 

 

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: how to locked and give a warning to user when they edit the form but already open by another use

Hi,

 

as I mentioned already: I did that for a customer-project quite a while ago. Basically I did the following:

 

  1. Create a custom list to hold the locking information. Add columns like "listname" and "item-id".
  2. Create some JavaScript, that would check if for the currently displayed item an entry exists in the list, which was not created by the current user. Add the script to the "editform.aspx".
  3. If such an entry exists, check if the entry is older than a certain threshold. If yes, then remove the entry from the list, as it may be stale. If the entry is not older than the threshold, display a message to the user and redirect the user from the edit-form to the "dispform.aspx".
  4. If no such entry exists or the entry was stale and got removed, create a new entry in the locking-list with the current item-id (the current-user and date are OOTB filled by SharePoint in the creator and created fields).

Thats basically what you need to do.

0 Kudos
Accept as Solution Reply