Delete Opportunity Contact Roles for Deceased Contacts

Cover image of fictional book
Don’t forget to handle your technical debt in the afterlife.

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. ”

Image of Flow Builder

Read Vanessa Chalem’s blog on Salesforce.org for another reason to delete OCRs!

Published by

JessieRymph

Jessie joined Salesforce.org in 2018 to give introductory webinars to nonprofit customers. She now is a Senior Solution Developer supporting nonprofits and education customers at Salesforce. All opinions expressed on this blog are her own or those of the contributors. She's spent 17 years more or less in CRMs and databases, but didn't meet Salesforce until 2011. Jessie co-led the Seattle Salesforce Nonprofit User Group in 2015-2016. She wrote a sh*tty first draft of a novel and hopes to turn it into a screenplay!

Leave a Reply