none
Delete Associated Task on WF Rejection

    Question

  • HI,

    I'm puzzled because I cannot find a way to delete the associated tasks when the Item is Rejected. Following is my action on Rejection in "When a Task Completes" section.

    The workflow does stop but the associated task remains in the Task list. What steps do I need to include in order to delete the associated task?


    Regards, Kapil ***Please mark answer as Helpful or Answered after consideration***

    Friday, July 19, 2013 5:36 PM

Answers

  • Hi,

    You can create an action delete item, then select associated task list.  Set the fields to match the query as shown the screenshot.

    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever you see a reply being an answer to the question of the thread, click "Mark As Answer

    • Marked as answer by K-Joshi Saturday, July 20, 2013 7:42 PM
    Saturday, July 20, 2013 9:30 AM
  • There could be multiple tasks created by the workflow and they will have the same title so you won't it will just select the first item in the list that matches. But you have the right idea. If it is the same workflow that creates the task that will delete it then you should have the task ID which will be passed back on creation. Then just delete the task using the ID field in the query. If this is not the case you do need to use a separate workflow in th task list. Cheers B
    • Marked as answer by K-Joshi Saturday, July 20, 2013 7:42 PM
    Saturday, July 20, 2013 10:17 AM

All replies

  • Hi, I think the best way to do this is by having a separate workflow in the task list. Check that the current task was created by the workflow above. Then have it wait until the task is completed, then if rejected delete? Cheers B
    Friday, July 19, 2013 9:05 PM
  • I believe, neither workflow cannot fire on delete item nor can a workflow that is running to respond to delete item.

    through eventhandler only we can do this.


    Sekar - Our life is short, so help others to grow

    Whenever you see a reply and if you think is helpful, click "Alternate TextVote As Helpful"! And whenever you see a reply being an answer to the question of the thread, click "Alternate TextMark As Answer

    Saturday, July 20, 2013 6:38 AM
  • Hi Sekar, The request is not to action on delete but to delete the task when it is rejected.
    Saturday, July 20, 2013 8:22 AM
  • Hi,

    You can create an action delete item, then select associated task list.  Set the fields to match the query as shown the screenshot.

    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever you see a reply being an answer to the question of the thread, click "Mark As Answer

    • Marked as answer by K-Joshi Saturday, July 20, 2013 7:42 PM
    Saturday, July 20, 2013 9:30 AM
  • There could be multiple tasks created by the workflow and they will have the same title so you won't it will just select the first item in the list that matches. But you have the right idea. If it is the same workflow that creates the task that will delete it then you should have the task ID which will be passed back on creation. Then just delete the task using the ID field in the query. If this is not the case you do need to use a separate workflow in th task list. Cheers B
    • Marked as answer by K-Joshi Saturday, July 20, 2013 7:42 PM
    Saturday, July 20, 2013 10:17 AM
  • Hi,

    That's idea, I have just given the screenshot how to use the delete item task.  You can create a workflow variable and store the task id and then later use the same workflow variable for deleting the task.

    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever you see a reply being an answer to the question of the thread, click "Mark As Answer

    Saturday, July 20, 2013 2:43 PM
  • Thank you all for putting your points across. I was aware of the delete item and using the reference of ID to delete the associated task and I guess that would be the way to go about it. As of now, there is only one task created at the stage where rejection is possible so I should not have a problem in identifying it and deleting it.


    Regards, Kapil ***Please mark answer as Helpful or Answered after consideration***

    Saturday, July 20, 2013 7:38 PM