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:
The Merge Accounts page URL:
A Parameter to indicate that SFDC should start merging, and it will expect account IDs to be on the URL:
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:
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:
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=001200000012348It 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
Thanks, quite a neat trick!
ReplyDeleteIs this still valid? or Salesforce shuts it down?
ReplyDeleteYes this works fine..
ReplyDeleteI got a "insufficient privilege" error, what am I doing wrong?
ReplyDeleteCan you normally merge accounts Marie-Eve? what happens when you try to goto just /merge/accmergewizard.jsp ?
ReplyDeleteYes, 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
ReplyDeleteWhat I have to do to merge more than 3 at the time, when I'm on the search page of Merge My Accounts?
Thanks!
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.
ReplyDeleteOh ok, I guess I have not the knowledge to do it then... Thanks anyway
ReplyDeleteHow can i check Based on Email
ReplyDeleteThis is great trick.
ReplyDeletebut 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
I've updated the post, but if you add "&p2=" this will select which one is the master record.
ReplyDeleteMany thanks Fosnez
ReplyDeleteThis 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 !
What would be the benefit?
ReplyDeleteWhat would be the benefit?
ReplyDeleteHai Author, Very Good informative blog post,
ReplyDeleteThanks
That was a really informative post.
ReplyDeleteThanks a lot!
Will you please give me example link that how to I use 'p2=ACCOUNTID'
ReplyDeleteThanks 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.
ReplyDelete