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.
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.
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
to check when the status field in the form changes to anything but pending.
Once it changes you can End Task Process to cancel the task.
After spending 3 days trying to work out why columns wouldn’t appear after being promoted from InfoPath, we finally resolved it today. This form had been previously working but the client decided they wanted more fields promoted.
The bad news is that it kind of solved itself. All I did was go back to basics and republish the form. Although I was told that we had tried this many times I just did it again on my pc. Previously it had been published from another pc. The columns appeared in the content type created by this form.
I then had to manually add the columns to the list from existing columns in that content type.
There are many people online complaining about having this issue but I can’t find anyone who can suggest a good answer. My suggestion is to try and republish your form until it works.
One way to go about "resolving" this problem is to delete the columns and then re-publish your InfoPath form.
Delete columns using PowerShell in SharePoint 2011. Get the PS script for deleting columns from this blog. After you run this script you can delete specific columns with the command: Delete-WorkflowColumn -webURL http://portal -listName "Documents" -columnName "Column Name"
function Delete-WorkflowColumn ($webURL, $listName, $columnName)
#Setup variables from the user input
$web = Get-SPWeb $webURL
$list = $web.Lists[$listName]
$column = $list.Fields[$columnName]
#Make sure the column is not hidden or read only
$column.Hidden = $false
$column.ReadOnlyField = $false
#Delete column and dispose of the web object
write-host "Deleted column"
Now re-publish your InfoPath form.
The new InfoPath columns will appear with correct settings.