Right now, when I go to an account such as "Netflex" and click on "New Opportunity" on the related list. I then can create a new opportunity with the account name automatically populated for you. How can I do this on a custom button?
Thanks
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityRight now, when I go to an account such as "Netflex" and click on "New Opportunity" on the related list. I then can create a new opportunity with the account name automatically populated for you. How can I do this on a custom button?
Thanks
if you are trying to populate the standard Account field only, then the HTML ID that should interest you is accid :
Create button as like the screenshot below :
and enter button or link URL as - /006/e?retURL=%2F{!Account.Id}&accid={!Account.Id}&ent=Opportunity
You can populate the Account field through URL hacking:
put in the URL the account name as a value of page input id: /006/e?opp4={!Account.Name}
opp4 = input element id in HTML in object layout (click on inspect in browser to see the input element id)
the following link has detailed instructions on how to do this: https://focusonforce.com/configuration/salesforce-url-hacking/