+ Start a Discussion
fifedogfifedog 

iniate Merge from current account

I'm trying to use the current merge function of Salesforce but I want to initiate the merge process from an Account record I'm on instead of going back to the accounts tab, click on the merge link, type in the name. 

 

Here is my current code below however I'm getting this error: http://screencast.com/t/oub5ql4u6B

 

 

<script type="text/javascript"> top.location.href ="merge/accmergewizard.jsp?retURL=%2F001%2Fo&srch={!Account.Name}"; </script>

 

Best Answer chosen by Admin (Salesforce Developers) 
werewolfwerewolf

Yeah, I have no idea on that.  Maybe try using single quotes instead of double?

 

Oh -- is this in a custom button?  You shouldn't put script tags in that.

All Answers

werewolfwerewolf
Well, for one thing, you're missing the slash at the very beginning of the URL.
fifedogfifedog
haha... thanks, but added the slash and still no joy.
werewolfwerewolf

Honestly, I'm not sure you can really make the merge page work that way, that's really going off the reservation there. 

 

The issue you're seeing is on the detail page though, so you might be able to debug it just by eyeballing the generated code (look for your srch= to find the code that was generated).  Could be that the spaces in the account name, or some quotes or apostrophes, are messing with the URL.

fifedogfifedog

hey it's not that far off and yes I know it's URL hacking but it works! if anyone can give me another solution to iniate a merge from an account I'm open.

 

spaces don't matter, I've put the exact account name in the url and it works fine. It's just not working when trying to do it this way.  I guess I'll have to verify the field from the source again.

fifedogfifedog
here is a screen shot of the full text and URL that I've tested with.
werewolfwerewolf

Yeah, I have no idea on that.  Maybe try using single quotes instead of double?

 

Oh -- is this in a custom button?  You shouldn't put script tags in that.

This was selected as the best answer
fifedogfifedog
that was it, the script tags. I removed those and it worked!
Anup JadhavAnup Jadhav

Hi guys,

 

I've got a bit advanced question regarding merge url.

 

If you type in this url :

 

https://cs1.salesforce.com/merge/accmergewizard.jsp?srch=Acme

 

You  get the Step 1 of the wizard.

 

What is the url to go directly to Step 2 of the wizard, if I have the acount id's to be merged?

 

Thanks in advance!

Himanshu ParasharHimanshu Parashar

you can go to directly on second page of merge account wizard using following URL parameters

 

merge/accmergewizard.jsp?goNext=+Next+&cid={yourfirst account id}&cid={yoursecondid}

Daniel ShaheenDaniel Shaheen
Is this still valid? or Salesforce shuts this hack URL?
vcharletvcharlet
Still work with an apex:outputLink, i was unable to call in a controller with a new PageReference('/merge/accmergewizard.jsp?goNext=+Next+&cid={yourfirst account id}&cid={yoursecondid}'), the second cid parameters just disappear !?