DEV Community

Demo
Demo

Posted on • Originally published at orgdoc.dev

How to find and merge duplicate accounts in Salesforce

Let's be honest: duplicate accounts are a silent killer in Salesforce. I've seen it cost a global manufacturing client $250k in wasted marketing spend last year because their sales team was chasing two separate accounts for the same company. Here's how to kill duplicates for good, no fluff, just actionable steps from my 8 years managing enterprise orgs.

Step 1: Identify Duplicates (Don't Rely on Standard Tools Alone)

Standard Salesforce "Merge Duplicate Accounts" tool only catches exact matches. Real duplicates have subtle variations: "Acme Corp" vs "Acme Corporation", or accounts with different phone numbers but same website. I used this SOQL in a healthcare client to find near-misses:


SELECT Id, Name, BillingCity, BillingState, Phone, Website 
FROM Account 
WHERE Website != null 
AND (Name LIKE '%Corp%' OR Name LIKE '%Inc%')
ORDER BY Website

Enter fullscreen mode Exit fullscreen mode

This found 142 accounts sharing the same website but with inconsistent naming. The key? Focus on high-value attributes (website, phone, industry) rather than just name.

Step 2: Validate Before Merging (The Critical Step You Skip)

Never merge without confirmation. In a financial services org, I caught a duplicate account that was actually a parent/child relationship (one was a subsidiary). I built a validation script using:

  • Account hierarchy checks via ParentId

  • Matching opportunities with closed/won status

  • Verifying contact ownership consistency

Example: If Account A has 12 closed opportunities and Account B has 3, they're likely not duplicates. Merge only when all key data aligns.

Step 3: Merge Using the Right Tools (Avoid the "Merge All" Trap)

Always use Salesforce's native merge tool—never mass-update. Here's my workflow:

  • Export the duplicates (using Data Loader) with all relevant fields

  • Manually select the "master" account (keep the one with most activities/relationships)

  • Map fields carefully: Merge opportunities to the master, but keep contact ownership separate

  • Never merge accounts with active contracts or open cases (pause automation first)

In a retail client, I had to merge 48 accounts for a single franchise. We kept the account with the latest marketing campaign record and moved all contacts to it, avoiding broken campaign links.

Step 4: Prevent Future Duplicates (The Real Win)

One-time fixes fail. I implement three controls:

  • Validation Rule: NOT(ISBLANK(Website)) && Account.Name LIKE '%[A-Za-z0-9]%' AND Account.Website IN (SELECT Website FROM Account WHERE Website != null)

  • Account Name Standardization: Enforce naming via a picklist (e.g., "Acme Corp, Acme Inc, Acme Corporation" all map to "Acme Corp" via a custom field)

  • Real-time Deduplication: Use a tool like OrgScanner to flag duplicates before record creation

After implementing these, a pharmaceutical client reduced duplicates by 92% in 3 months.

Here's the brutal truth: If you skip validation, you'll merge accounts and lose critical data. I've seen teams waste 15+ hours rebuilding relationships after botched merges. Always: Export, validate, merge one batch at a time, then verify with a report.

Stop letting duplicates bleed your revenue. If your org is drowning in account noise, get a free Salesforce health scan—it’ll pinpoint your duplicate risks and fix them in 24 hours. No fluff. Just data.

📚 Recommended Resource: Salesforce for Dummies — great for anyone learning Salesforce.


Need a second opinion on your Salesforce org? Request a diagnostic.

Top comments (0)