function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DDeFranceDDeFrance 

Workflow Delete Tasks Based upon Opportunity Stage

I have a use case where when an opportunity hits a certain stage, say Pending, then tasks are created via workflow.  This works great.  But I also have a use case where if the opportunity moves to a further stage, say Closed Won, then the previous tasks are no longer necessary and I want them deleted without further action by the assignee.

Is there a way to do this out-of-the-box?  I am sure I can write an Apex trigger to do this, but it would require carnal knowledge of any workflows and I want this to be very configurable for my team in the future.  So, how can I clean up obsolete tasks?

Thanks in advance.
salesforceuser9salesforceuser9

I am working with a very similar situation where the tasks are created automatically by workflow for an Opportunity Stage.

Is it possible to automatically change the Stage when the tasks are completed? In my situation, the tasks are mandatory for a change in stage to occur.

Sorry, I have no solution to your situation either!

kim_lebiczkim_lebicz
Do the tasks necessarily need to be deleted? Could they just be closed? If so, you can create a Field update workflow that would change Closed to true.
kim_lebiczkim_lebicz
Sorry, my mistake. I was thinking more of cases not Tasks.
LogoJonLogoJon
I also need to auto delete tasks and other custom objects. Any help?