I need to delete an account record, but prevent deletion if any of the child contacts is in the active state. How can i do that?
*This post is locked for comments
I need to delete an account record, but prevent deletion if any of the child contacts is in the active state. How can i do that?
*This post is locked for comments
Hi Santosh,
Normally you should be able to do this by just configuring relationship like Gautam suggested but I assume you are using contact_customer_accounts out of the box relationship between Account and Contact. If so, you wont be able to configure the Delete behaviour, please see below
You could create a Custom Workflow Activity (CWA) to check if Account has Active Contacts, and use that in a Real-Time workflow to prevent the record being deleted.
In your real-time workflow, if the CWA returns false, you can use Stop Workflow step with Cancelled state and display the message saying account cannot be deleted because it has active contacts.
Hope this helps
Hi Santosh,
This can be done by easily using Relationship behavior called "Referential Restrict Delete".
André Arnaud de Cal... 291,711 Super User 2024 Season 2
Martin Dráb 230,458 Most Valuable Professional
nmaenpaa 101,156