function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Robbi ConverseRobbi Converse 

custom button to create a new record for custom object

I have a custom object "Service Agreement". I need a button on the opportunity page to create a new "Service Agreement". This seems like it should be pretty simple, but I am not having any success (possibly due to my lack of experience with coding).
Best Answer chosen by Robbi Converse
Gulshan Raj 4Gulshan Raj 4
Hi Robbi,

Please follow step:

1) Grab salesforce object id from url. Just like I have "a01" for Employee custom object
User-added image
2) Go to Customize->Opportunities->Buttons, Links, and Actions
Click on "New Button or Link" 

3) Follow image steps as sample

User-added image

4) Add this button into your Opportunity page layouts.


Thanks
Gulshan Raj

All Answers

Gulshan Raj 4Gulshan Raj 4
Hi Robbi,

Please follow step:

1) Grab salesforce object id from url. Just like I have "a01" for Employee custom object
User-added image
2) Go to Customize->Opportunities->Buttons, Links, and Actions
Click on "New Button or Link" 

3) Follow image steps as sample

User-added image

4) Add this button into your Opportunity page layouts.


Thanks
Gulshan Raj
This was selected as the best answer
Robbi ConverseRobbi Converse
Thank you, Gulshan! With the slight change of taking the object id from the page after clicking new on the custom object, this worked perfectly!!! 
Cosimo ElefanteCosimo Elefante
Hi Guys, how could I get the Opportunity.Id in the button and copy it into the new "service agreement"?
Jonathan Friedl 30Jonathan Friedl 30
With a flow