I want to pass parameters from the account to an opportunity while allowing users to still choose the opportunity record type. From my understanding, Salesforce natively does this by encoding the URL in JavaScript. When I try to reverse engineer the URL using http://meyerweb.com/eric/tools/dencoder/ Salesforce returns an error. Can anyone provide some insight?

The business goal here is to default a naming convention by passing Account parameters to the Opportunity.Name field. Can I do this while avoiding the need to create a new button for each record type?

This is as far as I got.


You need to ensure that you don't URL Encode the {! } around your fields. Try to encode your URL first without the values (or use a placeholder like XXX), then replace the field values after the encoding.



| improve this answer | |
  • Thanks @Michael, that was actually the problem. I really appreciate the extra set of eyes. For those in need in the future, here is actually the code that works. The last parameter pre-populates the opportunity.name field. https://cs7.salesforce.com/setup/ui/recordtypeselect.jsp?ent=Opportunity&retURL=%2F{!Account.Id}&save_new_url=%2F006%2Fe%3FretURL%3D%252F{!Account.Id}%26accid%3D{!Account.Id}%26opp3%3D{AutomatedAfterSave} – d5al Dec 27 '13 at 0:13

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.