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
ShaTShaT 

Add Custom button in Related List

hi,

 I want to add a custom button in Related List.

 for example  I have a custom button named add in contact and i want that button in account  Related List.

Best Answer chosen by Admin (Salesforce Developers) 
Ankit AroraAnkit Arora

Hi Shailu,

 

First you have to create a custom button on contact whose display type should be "List Button"

 

Setup > App Setup > Customize > Contact > Button And Links > Custom Button And Links > New > Create custom button with display type "List Button"

 

Now your button is ready to be used on related list. Now if you want to add this on account's contact related list 

 

Setup > App Setup > Customize > Accounts > Page Layout > Edit > Go to related list > Properties of Contact Related list > Buttons > Select your custom button from multiselect picklist and add it in Selected Button picklist > Save.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

All Answers

Ankit AroraAnkit Arora

Hi Shailu,

 

First you have to create a custom button on contact whose display type should be "List Button"

 

Setup > App Setup > Customize > Contact > Button And Links > Custom Button And Links > New > Create custom button with display type "List Button"

 

Now your button is ready to be used on related list. Now if you want to add this on account's contact related list 

 

Setup > App Setup > Customize > Accounts > Page Layout > Edit > Go to related list > Properties of Contact Related list > Buttons > Select your custom button from multiselect picklist and add it in Selected Button picklist > Save.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

This was selected as the best answer
ShaTShaT

Hi Ankit Arora,

 

Thanks a lot....

Marc G.ax1040Marc G.ax1040

Hi Ankit,

 

I have a VF page with standard controlller Opportuntiy. I m trying to create a custom buttom on custom object by selecting the VF page. The problem is that i m not getting my VF page in the picklist to select the page. Plz help

Marc G.ax1040Marc G.ax1040

I figured it out, it was very simple. On the custom object  while creating custom button , select the URL and enter 

apex/yourpagename?id={!Opportunity.Id} . 

HelenHHelenH

I am trying to accomplish the same thing, however the url you provided with my vf page name is not working. How can I use my vf page for a custom list button for opportunities?

Marvin H. BituinMarvin H. Bituin
Correction:
/apex/yourpagename?id={!Opportunity.Id}



 
Sunil Shah 12Sunil Shah 12
Thanks Ankit Arora :)
Liz MalmanLiz Malman
Hi Shailu,

I know I'm a few year late but can you help me create the "Add" button you mentioned above? I'm looking to create that same cutton in my org but I'm not sure how to approach the code for it.

Thanks,
Liz
 
AmrutAmrut
Is it possible to add new action/button along with edit/delete values in drop down in salesforce lightning in the related list record.
In Opportunity record(in lightning) i have a related list. In the related list record we drop down actions edit and delete. I would like to add a custom action/button which will make a call to lightning component or vf page.

User-added image

thanks
amrut
Bryan Revelant 21Bryan Revelant 21
@Amrut - No... You have to use the Visualforce Page.... I couldnt find anyone anywhere where they added a Lightning Component or a redirect to a custom action
vikrant Chauhan 5vikrant Chauhan 5
Hi Amrut,

You can add the button by going into the page layout > related list > adding button. Also, you have to create the button on that object (related one) and you can call flow, vf page or lightning component by using that button.

Thanks,
Vikrant