Workflow - responding to completed task gives error page


Badge +7

Hi all,

I have a scenario where a workflow creates a flexitask and assigns it to a group of people.

All the users get the notification e-mail that has the "Click here to respond to the task" link in it:

Untitled.png

When the first user clicks and responds to the task, the task is marked as complete - all is good.

However, when another user (or the same user as before for that matter) uses the link, she is taken to a page with an error message:

Untitled.png

If find that quite user-unfriendly (user hostile?). Is there a way to avoid this, and get to a page that in a nicer way informs the user that the task is already completed, and maybe even show the outcome of the task?

I am aware of the "Response no longer required" setup on the Flexitask, but that is not what I am looking for. Even though somebody received such a message, it should still be possible to get to some decent place when using the link in the first e-mail.

Ideas anyone?

Regards

Leif


18 replies

Badge +16

What is the link pointing them to?  have you inserted the link or have you used the common approval task link?

I believe the standard behaviour is to take the users to the completed task which is read only so that they can see it has been responded to and what the response was?

Also - what is the behaviour of your flexi task action (i.e. first response applies etc)?

Badge +7

Hi Cassy,

The link points to the the EditForm of the workflow task - something like this: https://mysite/Lists/Workflow Tasks/EditForm.aspx?ID=172

The Flexi Task is set up to use "First response applise".

Actually the ptoblem extends to (or originates from probably) that when just trying to view the tasks from the task list itself, I get the exact same problem:

Untitled.png

Now what's going on with that? confused.png

Regards

Leif

Badge +16

do you have access to the logs to see what the correlation ID gives you?  if not, ask your farm admin to look at the details of that correlation error which should give you a better understanding of the problem...

so just to clarify, you are manually putting the link into the email for them to respond to the task, rather than using the approval task link in the common tab?

Badge +7

I will try and get a look at the logs to see what the correlation says.

The link in the e-mail is the standard thing - not something that I designed myself.

Regards

Leif

Badge +16

as you said I think the issue is with the workflow tasks list and not this specific workflow.

please let me know what the logs would indicate as I am interested in the problem and resolution.

Badge +7

OK - got to the logs now :-)

Untitled.png

The log entries are:

1)

Application error when access /_layouts/15/NintexWorkflow/ApproveReject.aspx, Error=Item does not exist. It may have been deleted by another user.

2)

System.ArgumentException: Item does not exist. It may have been deleted by another user.

3)

Getting Error Message for Exception System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.InvalidOperationException: Outcome information is not available. ---> System.Exception: Cannot find item with id 7018 in list 'ShiftRecord'. Check the user has

at least read permissions. Current user: i:0#.w|osslef. ---> System.ArgumentException: Item does not exist. It may have been deleted by another user.  

And by examing this, I now see what the problem is: It is NOT the workflow task item that the system complains about (in log intry 1 and 2). Log entry 3 reveals this: Cannot find item with id 7018 in list 'ShiftRecord'.

To understand this, I will just give a little background on what the workflow is all about:

The users create items in the list 'ShiftRecord'. When created the items are having the permissions changed (by another workflow) i a way so the user who created the item can edit the item (but not delete it), and all other users can view the item (but neither change nor delete it).

When the user finds out that she really wants to delete an item, she initiates a workflow "Request deletion of Shiftrecord". The workflow creates a flexitask (this is the task that is causing this whole debate). Upon approval, the workflow deletes the Shiftrecord (the item that the workflow task points back to).

So - after approval the item that "owns" the workflow task no longer exists (but the workflow task itself does), and this gives the error message.

Phew - long story....

So the question boils down to: How can the user view a workflow task, where the "originating" list item no longer exists?

Regards

Leif

Badge +16

so the out of the box workflow task item will open the task and have the item properties detailed below it.  if my understanding is correct, the item details cannot be displayed as the item no longer exists?

to get around this, you may need to edit the form for the flexi task to remove the details of the associated item and just have a flat approve/reject and comments?  are you able to do that?  do you think that might work?

Badge +7

Hi Cassy,

I tried your suggestion and removed everything about the item itself from the task form.

Unfortunately the problem still remains.

Regards

Leif

Badge +16

Asim MahmoodAsim MahmoodRyan Greenaway​ isn't this the same problem we had a while back??!!

Userlevel 6
Badge +13

We do have this issue on one of our apps, but we have just let it be. The error message we actually get (SP 2010) tells the user that the item has been deleted, but this is the OOTB SharePoint error message, so something we may have to look forward when we migrate this app will be a more vague error message by the looks of things. Yay!

My best suggestion, very fudgy, would be to direct all users to a blank page with a query string parameter of the item ID in the URL, and then some JavaScript in this blank page that checks whether the item exists in the list and then redirects as appropriate. But a lot easier would be the Response no longer required email.

I think that the tasks fall over because of the "Related Content" field that looks up to original item.

Sorry I can't be of more help.

Badge +8

I think (based on my experience) you're right with your thought

Ryan Greenaway wrote:

We do have this issue on one of our apps, but we have just let it be. The error message we actually get (SP 2010) tells the user that the item has been deleted, but this is the OOTB SharePoint error message, so something we may have to look forward when we migrate this app will be a more vague error message by the looks of things. Yay!

My best suggestion, very fudgy, would be to direct all users to a blank page with a query string parameter of the item ID in the URL, and then some JavaScript in this blank page that checks whether the item exists in the list and then redirects as appropriate. But a lot easier would be the Response no longer required email.

I think that the tasks fall over because of the "Related Content" field that looks up to original item.

Sorry I can't be of more help.

At least the user who respond to an task, must have read permissions on the item related on the task. That is what you have taken into account if you use ItemLevelPermissions.

Sometimes the responding user needs contribute rights, for being able to respond to an assigned task

hope it helps, br oli

Badge +7

Hi Leif,

It is my understanding that the task is marked as completed as soon as the first person approves or rejects it (because of the first approver rule you selected).  The second thing that should happen is that the other people on the list should be getting an email that states that a response is no longer required.  It won't however delete the original email. So if they click on it, it is like clicking on an old hyperlink and SharePoint will return an error message.  Like Cassy mentioned, you won't be able to change that.

Do the other people get the no-response-required email?

Userlevel 7
Badge +17

‌, did you find a conclusion to this issue? Please let us know or mark a response that was helpful as correct.

Badge +7

Hi Andrew,

I don't have any good solution to this. It is Sharepoint standard behaviour, and what I could wish for, was that I could configure what page Sharepoint should show in case of different errors.

Regards

Leif

Userlevel 7
Badge +17

Correct, its hard to intercept this sharepoint result. Unless you do not link via email directly to the task but a page or list item, which is unfortunate. 

Badge +1

I got this error message after the first few tries.

Badge +7

Good day Leif Frederiksen‌,

I know this has been open for a while but I just ran into a similar issue on my side and after about two days of recreating and recreating I found a solution for my problem.

My scenario is that a user built a list for Individual Development Plan (IDP) creation where an Initiator creates their IDP and this would then workflow to the supervisor and then the manager.  When creating the IDP, the workflow kicked of and the workflow task was created. I could even see all the tasks in the workflow task list and waiting for approval.  All the necessary permissions.  I gave everyone contribute rights to the Workflow tasks as well as the IDP list.  Then when the supervisor gets the email to approve, they get this error message.  

"An unexpected error has occurred" - message and this is what the correlation ID detail looked like

10/02/2017 15:52:15.99 w3wp.exe (0x14B8)                       0x4188  SharePoint Foundation                 Runtime                                       tkau       Unexpected       System.ArgumentException: Item does not exist. It may have been deleted by another user.    at Microsoft.SharePoint.SPList.GetItemById(String strId, Int32 id, String strRootFolder, Boolean cacheRowsetAndId, String strViewFields, Boolean bDatesInUtc)     at Microsoft.SharePoint.SPList.GetItemById(Int32 id)     at Nintex.Workflow.NWListWorkflowContext.get_WorkflowInstance()      f199d65a-4109-44cd-bcf4-dfbb4b1dbfb2

10/02/2017 15:52:16.00 w3wp.exe (0x14B8)                       0x4188  SharePoint Foundation                 Monitoring                                    b4ly        Medium               Leaving Monitored Scope (Request (GET:http://intranet:80/sites/Spr/hr/HRD/_layouts/NintexWorkflow/ApproveReject.aspx?List=c4598029%2Debc7%2D4e6d%2D95d8%2D8bd5d178655d&ID=316&Web=49a2f5f3%2D2290%2D4601%2Dba36%2D269d188082f4)). Execution Time=75.4029               f199d65a-4109-44cd-bcf4-dfbb4b1dbfb2

So I narrowed it to down to the problem being with the Workflow task list but this did not seem to be the case.

Eventually I changed the Advanced setting in my IDP list.  It was on Read items created by and on Create and Edit items created by.  I changed it back to the default settings as shown below.

208790_Capture.PNG

I think that somehow the workflow's auths was linked to the initiator's auths and because the workflow was run by the initiator, the supervisor did not have access to the task and that's why it seemed like the task is not there anymore.  I hope this is some bug in SharePoint and will be gone in later versions because I think the advanced settings is a nice option on some lists.

Let me know if this helped you.

Userlevel 7
Badge +17

I believe this is a good answer to the problem, but there may be some additional investigation needed into the workflow task list to make sure this isn't an expected outcome also. But this is a good lead to review and make sure it is not the cause. 

Reply