Forum Discussion
SharePoint Workflow Deleted Task
Just some additional info. Will it be possible to redirect into another webpage so that can display the task was deleted or workflow was canceled rather than a generic error (see attached file)?
The log entry is as follows:
Application error when access /_layouts/15/WrkTaskIP.aspx, Error=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, Boolean bExpandQuery)
at Microsoft.SharePoint.SPList.GetItemById(Int32 id)
at Microsoft.Office.Workflow.WrkTaskIPPage.OnLoad(EventArgs ea)
- Eugene BooyensMar 12, 2018Copper Contributor
Hi there, did you have any luck resolving this? I just upgraded a 2010 farm to 2013 and having this problem on a tasks list. Thank you!
- Fred YMar 14, 2018Iron Contributor
Hi, Eugene Booyens,
Unfortunately, no luck in the actual resolution. The workaround I've created uses the following which applies only for "new" workflow activities.- Used REST API and AJAX based JavaScript that checks if the Task exists.
- Created a web part page called WrkTask.aspx that refers to the JavaScript in step 1.
Created another web part page called WrkError.aspx that displays "Item Not Found" text. - Revised my workflow to point to the web part page in step 2.
[%Workflow Context:Current Site URL%]/SitePages/WrkTask.aspx?TaskId=[%Current Task:ID%]&ApprovalId=[%Current Task:Approval Item Id%]
When the user clicks on the email link, the web part page in step 2 checks whether the Task still exists and redirects to the current Task item, otherwise, it redirects into WrkError.aspx page.
Fred YReference:
- Eugene BooyensMar 15, 2018Copper Contributor
Thank you very much for coming back to me and providing your workaround, very useful thanks! I ended up calling Microsoft and I found that this form was specified on the Content Type - Microsoft was going a different route but their assistance did help in part. If you use SharePoint designed to go to the affected list, and then click on the content types, on the right it has a section to specify forms specifically for the content type and these were overriding the forms on the list. I deleted the references to WrkTask.aspx on all content types and everything is working now. Still don't know where that form name came from in the first place. Thanks again.
- Used REST API and AJAX based JavaScript that checks if the Task exists.