I had a custom button which creates a clone opportunity with certain fields filled in which was working fine. I'm trying to make some tweaks to the button I must have inadvertently broken something because now instead of making a "Clone" of the opportunity, it is overwriting the opportunity itself.

URL Redirect:

/{!Opportunity.Id}/e?clone=1&retURL=%2F{!Opportunity.Id}&opp11=Negotiation/Review&00N90000008WzB7=2-Best Case &opp9={!Opportunity.Orig_Renewal_Date__c}&opp5=Renewal&opp12=90&opp3={!Opportunity.Name}+- ({!(Opportunity.Orig_Renewal_Date__c)})+Renewal&00N1a000008JgOJ=0&opp9={!Opportunity.Expire_Date__c}

I'm sure it is something simple, but I can't seem to figure it out.

  • You can put the code here behind the button – Santanu Boral Jun 27 '16 at 18:26
  • Hi Santanu, I'm not sure what you mean. The code is behind the button already. Were you referring to some other code? – megachuck Jun 27 '16 at 18:30
  • whats the URL it is generating? – Santanu Boral Jun 27 '16 at 18:32
  • shncrm.skyhigh.myshn.net/0061a00000Fxyn8/e? clone=1&retURL=%2F0061a00000Fxyn8&00N600000037Qdt=1&opp11=Negotiation/Review&00N90000008WzB7=2-Best Case &opp9=6%2F27%2F2017&opp5=Renewal&opp12=90&opp3=New+First+Order+-+%286%2F27%2F2017%29+Renewal+-+%286%2F27%2F2017%29+Renewal+- (6%2F27%2F2017)+Renewal&00N1a000008JgOJ=0&CF00N1a000008Ja4z=N/A – megachuck Jun 27 '16 at 18:36
  • You could also use my free app to clone, appexchange.salesforce.com/… – Dave Helgerson Jun 27 '16 at 19:33

I think you need to append something like:


Updating the answer as below

Behind my custom button I have used this code and it is perfecting cloning.

var url = "/{!Opportunity.Id}/e?clone=1&retURL={!Opportunity.Id}&common.udd.actions.ActionsUtilORIG_URI={!Opportunity.Id}/e"; window.open(url, "_self");

And it is opening on the same window. Please let me know if this helps!

  • Tried that... it made no difference. The new "Cloned" opportunity pops up in a separate window and I still see the original opportunity in the other window, but if I refresh the old window it shows me the new clone. – megachuck Jun 27 '16 at 18:55
  • let me try at my end. – Santanu Boral Jun 27 '16 at 20:16
  • Please check and modify the url as per your requirement. – Santanu Boral Jun 27 '16 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.