Thursday, November 8, 2012

Salesforce Merge Accounts URL Hacking

The Merge Accounts page is OK to use, however to start the process you have to search for the Accounts you want to merge, and to do that they have to have the same name. This is not always the case, and it can be annoying to have to rename an account, just so you can find it to merge it.

The official SFDC selection screen also limits you to a max of 3 accounts. This isn't actually a hard limit... More of a guide, as you'll see below.
Instead of this, you can actually hack the URL to include the IDs of any accounts, regardless of Account Name similarity. This is especially useful if you are using your own code to manage merges and would like to "deep link" into the SFDC platform.

Here's an example URL:
https://emea.salesforce.com/merge/accmergewizard.jsp?goNext=+Next+&cid=001200000012345&cid=001200000012346&cid=001200000012347&cid=001200000012348
It can be broken down into 3 main segments:

The Merge Accounts page URL:
https://emea.salesforce.com/merge/accmergewizard.jsp


A Parameter to indicate that SFDC should start merging, and it will expect account IDs to be on the URL:
goNext=+Next+

The last segment is a collection of SFDC Account IDs. All use the parameter name of "cid". In the above example there are 4, however you may include as many as you like (I've successfully merged 75 accounts at once), including more than the default 3 allowed by the web form:

cid=001200000012345
cid=001200000012346
cid=001200000012347
cid=001200000012348


Replace these IDs with the Accounts you would like to merge, and you should be presented with the familiar Merge Account page.

To select what account should be the "Master Record" put add this to the url:

p2=ACCOUNTID


18 comments:

cawoodm said...

Thanks, quite a neat trick!

DNS Cloud said...

Is this still valid? or Salesforce shuts it down?

Thahaniyath said...

Yes this works fine..

Unknown said...

I got a "insufficient privilege" error, what am I doing wrong?

Fosnez said...

Can you normally merge accounts Marie-Eve? what happens when you try to goto just /merge/accmergewizard.jsp ?

Unknown said...

Yes, I can merge account with the SF regular tool (3 at the time) at this url: https://na9.salesforce.com/merge/accmergewizard.jsp?retURL=%2F001%2Fo

What I have to do to merge more than 3 at the time, when I'm on the search page of Merge My Accounts?

Thanks!

Fosnez said...

I just tested merging 4 accounts and it still works. You have to generate the URL / link yourself - you cannot do it from the merge screen. Read through the instructions above.

Unknown said...

Oh ok, I guess I have not the knowledge to do it then... Thanks anyway

Unknown said...

How can i check Based on Email

Unknown said...

This is great trick.
but Is there any way to decide one account as Master and rest as accounts to be merged with Master ?

As the above link not able to decide Master account irrespective of the position of the Id within the URL

Fosnez said...

I've updated the post, but if you add "&p2=" this will select which one is the master record.

Unknown said...

Many thanks Fosnez
This is a very useful tool but I can't figure out how to make "&p2=" work to select the master record !

Can you please give us more details...

Keep on posting nice tricks !

Unknown said...

What would be the benefit?

Unknown said...

What would be the benefit?

Unknown said...

Hai Author, Very Good informative blog post,
Thanks

Unknown said...

That was a really informative post.
Thanks a lot!

Unknown said...

Will you please give me example link that how to I use 'p2=ACCOUNTID'

Shri said...

Thanks for this blog. Could you please let us know if the same works in lightning. I'm facing issue with lightning, works perfect in classic.

Post a Comment

Note: Only a member of this blog may post a comment.