deleting library item and associated approval task
-
Wednesday, April 18, 2012 4:26 PM
im pretty sure this question has been asked....
if i have a custom approval workflow (spd) running on an infopath form library, and then someone deletes the form, the workflow tasks do not get automatically deleted. normally this wouldn't be a problem, but there are overdue task emails that get sent fromt this workflow.
is there a way to fix this behavior?
~george
All Replies
-
Wednesday, April 18, 2012 5:00 PM
I do not think there is any out of the box solution for this behavior.
I would create ItemDeleting event receiver and will delete all associated workflow tasks from the task list.
Amit
-
Wednesday, April 18, 2012 5:24 PMthis was a sp designer workflow, so i suspect you mean a visual studio workflow event receiver?
~george
-
Wednesday, April 18, 2012 5:31 PM
-
Wednesday, April 18, 2012 5:57 PMpardon my ignorance, but this method would be invoked how?
~george
-
Wednesday, April 18, 2012 6:03 PM
You will attach this event receiver to your form library. When someone deletes an item in InfoPath form library this event receiver will run before item actually getting deleted.
In this even receiver you will write code to find all workflow tasks for the item that is getting deleted.
Amit
-
Wednesday, April 18, 2012 6:22 PMwhich would require visual studio?
~george
-
Wednesday, April 18, 2012 7:47 PM
Go into SharePoint Designer 2010 and republish your workflow. This will create a new workflow association in your forms library. It will also set the previous version instance to a state of not allowing any new instances. Once the previous workflow does not have any running instances, other than the ones related to the deleted items, then remove that workflow association. That should remove all workflow related notifications for that previous version workflow instance.
Chris Caravajal MCTS SharePoint911 Consulting & Support Services
- Edited by Chris Caravajal Wednesday, April 18, 2012 7:50 PM Needed to update text
- Edited by Chris Caravajal Wednesday, April 18, 2012 7:51 PM
- Marked As Answer by Emir LiuMicrosoft Contingent Staff, Moderator Thursday, April 26, 2012 3:21 AM

