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
lakshman.mattilakshman.matti 

Custom list view button with content source as Visualforce Page

Hi All,

I have created Custom list view button on child object(say contact) which is using Visualforce page as content resource.
When we add that button to the layout on the related list, we wont get check box's against records.
We can see check box's only when we go to the child records list view.
i want to throw a error message when no records are selected and throw error message if more than one records is selected.
Im choosing visualforce, because of java script limitations in Lightining.
Thanks,
Lakshman
 
Ajay K DubediAjay K Dubedi
Hi Lakshman,

In order for a visual force page to appear while creating a custom button on a detail page, you must use the standard controller for the object that will appear on the detail page.  Therefore, if you wanted to create a custom button from the contacts detail page, you must you the contact standard controller on the visual force page. 

You can add a custom controller extension to contain all the various custom code and functionality you require.

The visual force documentation shows how to set this all up.

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com