Cancelling a workflow approval request from an InfoPath form

24. May 2011 14:31 by sashashev in   //  Tags:   //   Comments (0)

We have a form which is used for requesting leave. We were asked to put a cancel button on it so that the requester could cancel their request if it has not been approved yet. This would need to cancel any attached workflows. The approval workflow is a standard SharePoint approval workflow.

The workflow is based around a task assigned to an approver in the workflow.

This task would be created by Start Approval Process in the workflow.

image

Unfortunately SharePoint does not provide a good solution for deleting this.

You could write an event handler but that’s hard to manage.

You could show users how to manually cancel workflows but that’s too complicated for some users.

You could create some whacky workflows that manage themselves but that’s too messy.

Our solution:

In the form create a status field. This field will have the following possible values: pending, cancelled, approved, rejected.

When a user cancels the leave request by clicking cancel in the form, we will update the status of the form to be cancelled. There will still be a task assigned to the approver that needs to be cancelled.

change the behaviour of the task

image

to check when the status field in the form changes to anything but pending.

image

Once it changes you can End Task Process to cancel the task.

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Webcoda, SharePoint Consultants & Web Development

SharePoint Development Sydney is a crack team of SharePoint Consultants and SharePoint Developers.

We can't tell you their names or show their faces on TV but if you need a SharePoint job done right, call them on +61 2 9370 3602 or email us at info@sharepointsydney.com.au

Persecuted by the Government and shunned by society they developed their SharePoint skills in back streets and labor camps where other programmers wouldn't dare to tread. 

During a trek through the Himalayas they stumpled upon the fabled Mossy Yak who shared his SharePoint knowledge of how to attain Nirvana through a series of Workflows and Event Handlers. Their mission is to spread this knowledge through-out the world to bring peace, harmony and document version control to all .

 

Month List