Quantcast
Channel: Microsoft Online: SharePoint Online forum
Viewing all articles
Browse latest Browse all 10096

Cancel/Terminate Workflow from Sharepoint Hosted App using JSOM gives access denied error

$
0
0

Hi,

I am creating a Sharepoint hosted app which triggers a SPD 2013 workflow in the Host web after an item is added/modified in the list. The SPD workflow is set to manually start option and i am using javascript object model to manipulate the workflow with the help of SP.WorkflowService.js.

The User is having Contribute without delete permission in the list. The app will create an item in the list on Host web based on the metadata filled by the user and start the workflow.

When the user is modifying the metadata in my app, I want to cancel/terminate the existing workflow and start a new instance. But I am getting access denied error when trying to Cancel the workflow using javascript.


The code which I am using to start/terminate the workflow is

workflowInstanceService.StartWorkflowOnListItem(firstWorkflowAssociation, listItemId, startParameters)

workflowInstanceService.CancelWorkflow(WorkflowInstance)

I have read in an article that the minimum permission required to cancel/terminate workflow is the person who has created the item or the person with manage list permission. Since I am starting my Workflow from Sharepoint Hosted App, the user should have permission to cancel the workflow. But still I am getting access denied.

Not sure if this is a bug.

Please respond

.



Viewing all articles
Browse latest Browse all 10096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>