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
Chris - ARIChris - ARI 

Delete Open Tasks on Record Update.

Hi All,

I'm pretty sure I can kick this process off (the rule criteria) in  Process Builder. However I don't believe the rest can be done without Apex. Can you help me out?

Object: Task

Rule Critria: Status = 'Completed' AND Response Type (custom picklist field) = 'Good Response'
This will either happen on a lead or a contact.

Action: Delete all activities where Status != 'Completed' AND where Process Type (custom text field) = 'Decision Tree'
I want to delete only the activites on the same related lead or contact where the task was updated.
I'm not aware of any method to delete records using Visual Workflow (PB, Flow, workflow, etc).   Pretty sure you'll need Apex for this.
There is a request to add delete feature to process builder perhaps vote on this Idea:
Chris - ARIChris - ARI
I know there is an Idea and I did vote for it. However, that doesn't help me now. I was wondering if someone would be kind enough to help me with the code?