Skip to main content

Record Merge

How to merge two records of any object, decide which values survive, and see what moved.

Overview​

Salesforce merges only accounts, contacts, leads, and cases. Record Merge works on any object in your org, custom ones included. You pick two records and choose which values the surviving record keeps. It moves the related records across and then deletes the other record.

It reports what it did step by step, and it stops instead of guessing. If something can't be moved, it keeps the record it would have deleted and tells you what still points at it.


Who can merge​

Record Merge has its own permission set.

Permission setGives
Flourish Core: Record MergeUse of the component and nothing else

Flourish Core: Admin already includes it, so an admin needs nothing extra.

Grant this deliberately. A merge runs with full access to the data whoever runs it. That's what stops a person's own record access from turning a merge into a half-merge. It also means anyone with this permission can copy field values and move related records they couldn't otherwise see.


Adding it to a page​

In the Lightning App Builder, drag Flourish Core: Record Merge onto a record page or an app page.

SettingWhat it does
Object API NameThe object whose records this component merges, for example Account or toflourish__Service_Request__c
Maximum HeightHow tall the component may grow before its contents scroll inside it. Use a CSS length such as 70vh or 640px, or leave it blank for the default.

On a record page, the record being viewed starts as the one to keep. You can change either picker.

Each component handles one object, so to merge households and organizations, place two.


Merging​

1. Pick the two records​

Record to remain is the record that survives. Record to delete is the one whose values and related records move across before it's deleted.

Each picker leaves the other record out of its results, so you can't pick the same record twice.

Under Record to delete is an Open in a new tab link. Two records worth merging usually have the same name, so open the one you're about to delete and check it's the one you mean.

2. Choose how values are decided​

Simple merge is the default, and it works the way Salesforce's own merge does. The record to remain keeps every value it already has, and its blanks are filled in from the other record. Nothing it holds is overwritten.

Turn on Advanced to choose field by field.

3. Review​

Review shows what the merge would do. Nothing is saved yet.

In Advanced mode, a table lists the fields alphabetically by label with both records' values side by side. Each row offers Keep or Take. Keep leaves the surviving record's value alone, and Take replaces it with the other record's.

Only the fields that differ are listed. A line under the table counts the rest, and Show fields with the same value brings them in. Search field names and values also looks through the fields that aren't on screen.

Related records comes next in both modes. It lists what points at the record you're deleting. Each line gives a count and says what will happen to those records.

MarkingMeans
Will moveThey'll be moved to the record to remain
Can't moveThe relationship doesn't allow moving them, so they stay where they are
Deleted with itChatter posts and comments, which can't be moved and go with the record

Chatter is the one thing a merge loses. Nothing can move it to another record, so the feed on the record you delete goes with it. Salesforce's own merge does the same. A warning above the list gives the count.

Click Merge when the review looks right. Click Back to change the records.

4. Read the result​

The merge runs as separate steps: the field copy, then one step per related list, then the delete.

Only the steps worth reading are listed. An object usually has dozens of relationships with nothing in them, and a line at the end counts those.

StatusMeans
DoneFinished
More to doThere was more work than one run allows. It carries on by itself.
SkippedYou chose to leave it alone
FailedIt couldn't be done. The step says how many records it affected.
Not doneIt wasn't tried because something earlier stopped the merge
Deleted with itChatter, removed with the record
Can't readYour org can't read that relationship. It doesn't hold the merge up.

A large merge can need more than one run, and the component keeps going on its own until it finishes or reaches something that needs a decision from you.


When a merge stops short​

We delete the other record only when nothing points at it anymore. If anything does, the merge stops, keeps both records, and says Merge stopped short.

The Still attached list names what's holding it there. What to do depends on which part failed.

A field couldn't be saved. A validation rule or a locked field is the usual cause. A button under the result offers to give up on those fields, named as Keep the original Field Name and try again. When it can't name them, it's Keep all original values and try again. Either way, it keeps the record to remain's own values and runs again, which usually finishes the merge.

Related records couldn't move. Continue without these leaves them where they are and finishes everything else. Those records stay on the record you wanted to delete, so that record is kept, too. Skipping a related list never lets the delete go ahead. It finishes the rest of the work and leaves one thing to sort out by hand.

Try again runs the merge again, and nothing has to be undone first. Every step is safe to repeat. Copying a value that's already there changes nothing, and a related list whose records already moved finds nothing left to move.


The older merge component​

Two older components are still in the package: Flourish Core: Record Merge (Deprecated) and Flourish Core: Smart Search (Deprecated). They stay installed so anything that refers to them keeps working, but they no longer do anything. The old merge names this component when you try to use it.

Nothing needs uninstalling. Take them off any page they're still on and use Flourish Core: Record Merge instead.