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
sindhu@demo.comsindhu@demo.com 

How to add Custom List Button in related list of Custom Object

Hi, I have created a VF page "AddMultipleOppy" which adds Multiple opportunities related to a custom Object "Project__c".I want this Vf page to be displayed as list button in related list of opportunities on "Project__c" object So,I have created the custom list button on "Project__c " object and tried to add this button on related list properties of "Opportunity" object in page layout but I could find this button. Am I missing out on anything?? Thanks Regards, Prasanna
Best Answer chosen by Admin (Salesforce Developers) 
Gunners_23Gunners_23

To make the list button appear on related list of "Opportunity" on "Project__c" you have to create the list button on "Opportunity"

 

not on "Project__c" object and add in the project object's pagelayout you can add the list button as mentioned earlier

All Answers

Gunners_23Gunners_23

For the button to appear...Go to the object pagelayout and click on related list in the pallette...which will scroll down the page

 

and click on "Properties" icon (spanner icon) on the object for which list button has been created. An overlay will open after

 

clicking containing two section columns and Buttons...Select Buttons from there select the list button you want to display

sindhu@demo.comsindhu@demo.com
Hi Gunners, Thanks for the reply.I already followed the same procedure but couldn't find this custom button!! Regards, Prasanna
Gunners_23Gunners_23

To make the list button appear on related list of "Opportunity" on "Project__c" you have to create the list button on "Opportunity"

 

not on "Project__c" object and add in the project object's pagelayout you can add the list button as mentioned earlier

This was selected as the best answer
sindhu@demo.comsindhu@demo.com
Now,when I am trying to access this button,the following error is thrown: URL No Longer Exists You have attempted to reach a URL that no longer exists on salesforce.com. You may have reached this page after clicking on a direct link into the application. This direct link might be: • A bookmark to a particular page, such as a report or view • A link to a particular page in the Custom Links section of your Home Tab, or a Custom Link • A link to a particular page in your email templates Can you help me on this?? Thanks
Gunners_23Gunners_23

Could you share the logic which is added on click of that button?....ex If you're using javascript on click of button then code for that

sindhu@demo.comsindhu@demo.com
I am using "url" in the button. '/apex/CreateMultipleOpp?id={!Construction_Project__c.Id}' It is working fine when used with 15 digit project Id (recordID) in the url directly but it is not working when used from this custom link button (i.e) /apex/CreateMultipleOpp?id=********************
Gunners_23Gunners_23

Could have made small syntatic difference between the two...Anyway pls compare the url that is generated on click of button

 

and the one which is working ( Directly providing the ID for the page)