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
Liz MalmanLiz Malman 

Create an Add Button on Related List

Hi all,

I'm looking to create an "Add" Button on my opportunities related list. I understand that the button type must be "List Button" and how to add the new button to the page layout. I am lost when it comes to writing the code for this "Add" button. Has anyone created a similar button or could someone point to a good place to start? 

Thanks,
Liz 
Lokesh KumarLokesh Kumar
Hello Liz,

What logic you want to achieve by pressing "Add" button.

~Lokesh

 
Liz MalmanLiz Malman
Hi Lokesh,

After the "Add" button is clicked, I would like to prompt the user with a lookup field where they can select the opportunity they wish to add.

Liz
Lokesh KumarLokesh Kumar
Hello Liz, Have a look here https://developer.salesforce.com/forums/?id=906F0000000MN07IAG seems like you have the same requirement, and to achieve your use case you need to write VF and Apex class.
Liz MalmanLiz Malman
Thanks Lokesh. So you do not believe there is a way to achieve this without VF and apex?