u/Few-Survey9021

A short list of "do not delete" conditions I wish I'd written down before my first cleanup job

A short list of "do not delete" conditions I wish I'd written down before my first cleanup job

**Bypass rules for safe record cleanup — the 8 I wish I'd had in writing before my first big delete job**

Every admin I know has at least one cleanup-gone-wrong story. Mine was a Lead cleanup in a sandbox that looked perfect, promoted to prod on a Friday afternoon, and Monday morning I learned I'd nuked a batch of records that had open Tasks referenced by a custom Apex trigger. The trigger went silent, the AEs went loud, and I spent the week rebuilding from the recycle bin and the weekly export.

The thing that finally made cleanup feel safe to run wasn't better selection logic — it was writing the bypass rules down first. Selection rules are what you're trying to delete. Bypass rules are everything that should survive no matter what your selection rules say. Most cleanup jobs ship with the first and skip the second.

Here are 8 bypass conditions worth having in writing before you run anything destructive:

**Relationship & engagement**

  1. *Contact / Lead with a reply on a Task or EmailMessage in the last 18 months.* Reply data is the highest-fidelity signal that a record is real. Don't let a LastActivityDate filter delete it.

  2. *Contact whose AccountId has an open Opportunity.* Obvious to write down, easy to miss in SOQL because people filter on the Contact's own activity and forget the join through to Opportunity.

**Ownership & blast radius**

  1. *Records owned by an active user with a System Administrator or Sales Operations profile.* These are usually special-purpose records (test accounts, integration-owned leads, exec exception flows). Deleting them silently breaks more than you'd think.

  2. *CreatedDate within the last 90 days.* Too new to judge. The cost of keeping a fresh dud is one row; the cost of deleting a fresh rep-sourced lead is a ticket in your queue by lunch.

**Compliance**

  1. *Any record with HasOptedOutOfEmail = TRUE, a GDPR/CCPA flag, or a legal hold field set.* These have their own retention logic governed by someone who is not you. Hygiene cleanup is not the right blast radius for them.

  2. *Anything referenced by a closed-won Opportunity, ever — Contacts via OpportunityContactRole, Accounts via AccountId.* You need these intact for attribution reports and the inevitable "why is this commission record missing context" ticket 14 months from now.

**Cross-object & integration safety**

  1. *Records with a related Case in the last 12 months.* Support data is its own world. Deleting a Contact mid-Case is the kind of thing that surfaces in a customer escalation, not in your validation report.

  2. *Records with an external ID populated from an integration (MAP, ZoomInfo, Clearbit, etc.) that was touched in the last 30 days.* If an upstream system thinks this record exists, deleting it in Salesforce just means it comes back on the next sync — minus all your activity history. Worse than not deleting it at all.

---

A few admin-specific things this list does not solve, and you still need to think about separately:

- *Trigger and Flow side effects.* Even a "safe" delete fires before-delete triggers, and if any of those touch other records or call out, you can chain-react in ways that aren't visible in a where-clause preview. Run in a full sandbox first, with debug logs on.

- *Recycle Bin behavior.* You have 15 days. Use them. Don't hard-delete on the first pass.

- *Recycle Bin doesn't preserve external relationships.* If a third-party tool already de-referenced the record, restore won't fix that downstream.

The full list I'm working from has 12 more rules covering territory ownership, partner/channel records, integration-managed fields, and patterns specific to multi-org and heavy MAP→CRM sync. If you want it, I'm running a short benchmark on cleanup practices and the full PDF goes out on submit — https://tally.so/r/jakrpE — contact info on the form is optional.

More interested in what's missing, though. What's on your bypass list that isn't on mine?

u/Few-Survey9021 — 14 days ago