Merge Accounts and Contact in Lightning like Classic

Hey there! 🙂

In today’s article, we shall discuss a quick and simple hack which will help us Merge Accounts and Contacts in Lightning just like we used to do in Classic.

Why the need for this hack?

Well, the merging of records works a bit in Lightning than Classic. In Lighnting, the merging of records is based on duplicacy. So if two records are duplicate(according to ‘Potential Duplicates’ LEX component), then you will be able to merge them using Potential Duplicates component. In classic, this is not the case and you can merge two records even if they do not qualify as duplicates. To know more, refer this links:

Merge Accounts: https://help.salesforce.com/articleView?id=account_merge.htm&type=5
Merge Contacts: https://help.salesforce.com/articleView?id=contacts_merge.htm&type=5

Having understood the difference, let’s see how we can use the Classic merge functionality in Lightning.

Idea

The solution to our problem is URL hack. The idea is to create 2 buttons, one for Contacts & one for Accounts.

Let’s roll!

For Account merge: Create a custom URL button of List type with the following URL:

 /merge/accmergewizard.jsp?retURL=/001 

Now add this button to the List View (Setup -> Object Manager -> Account -> Search Layout -> List View).

For Contact Merge: Create a custom URL button of List type with the following URL:

 /merge/conmergewizard.jsp?id={!Account.Id}&retURL=/{!Account.Id}

Now add this button to the Contact related list on Account Page layout.

How it looks!

Small catch!

While merging contacts, the Contact related list component doesn’t get refreshed. So the user will have to manually refresh the page.

Thank you for being an awesome reader! Subscribe to this blog for receiving all the latest updates straight to your inbox. 🙂

7 thoughts on “Merge Accounts and Contact in Lightning like Classic

  1. This is great thank you! Is there a way to hide the button from non admins without creating a VF page? They don’t have rights to merge but it would be better if they cannot see the button at all. Thanks

    Like

    • That’s a really good point. Right now what I can think is maybe using custom permissions you can conditionally redirect user to some url. Am not sure if we can access custom permissions in URL formulae, but worth a try.

      Like

  2. I had that thought, too, but then realized if I look the All Account list view, the new button is visible only in the drop-down menu next to the three buttons I’ve got visible on that page layout; if I look at the Recently Viewed list view, it’s not visible. Maybe this is just some chance outcome of the way I installed it, but it’s pretty great because largely hidden.

    Like

  3. This is great. I just added it to my search layout, but now I am wanting to edit the columns visible in the search view (existing ones aren’t very useful). Looks like SF hasn’t given end users the ability to customize this, but curious if you have a clever hack for displaying more/different fields when searching for Accounts to merge.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.