Question: When a contact dies, how can you use Flow to delete their Opportunity Contact Roles for open opportunities? Answer: With a Loop!
Here’s the unmanaged package.
Use common sense. Install and test thoroughly in a sandbox! You’re deleting records! I made it really quickly and did not test thoroughly!
Here are the requirements as posted by Ashlynn on the Power of Us Hub:
“I am trying to set up an autolaunched flow to remove Opportunity Contact Roles from open opportunities with deceased contacts. (For example, we are soliciting a major gift from a couple, and one of them passes away before the donation is received.) I have successfully configured a process to remove the deceased contact from acknowledgement for that gift when it comes in, but for the sake of clean data I would like to also automatically remove their OCR from the opportunity record. I am coming up with ‘unhandled faults’ and hoping since this is only my 2nd flow ever that someone will be able to see an obvious error with my configuration.
What should happen:
1. Contact is marked deceased
2. Process builder removes contact’s name from the acknowledgements for any outstanding open opportunities
3. Process builder launches a flow to delete that contact’s OCR’s on outstanding open opportunities
I will post screenshots below of my flow, but let me know if there is anything else it would be helpful to see. ”
Read Vanessa Chalem’s blog on Salesforce.org for another reason to delete OCRs!