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
Pranav_VaidyaPranav_Vaidya 

Can not add Visual Force page to Custom button

Hi,

 

I looked on the community and I found that there are several posts with similar topic. While it helped me understand what needs to be changed all those posts did not resolve my problem.

 

I want to create a Custom Link Button on my object which launches a VF page that I have developed. My VF page has this object as Standard controller. Yet when I select Content source as VF page the content drop down is empty.

 

This is my VF page starting...

<apex:page standardController="Leg__c"  extensions="LegsGroupBookController" tabStyle="Leg__c">

 

Any help is much appreciated.

 

Thanks. 

 

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

List button is different to a detail button though.  In order for your VF page to show up in the list for a Detail Button, it needs to use the standard controller.  However, in order to show up as a list button, it needs to use a standard list controller, as it can potentially receive more than one record.

 

There's more detail at:

 

http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#CSHID=pages_controller_sosc_about.htm|StartTopic=Content%2Fpages_controller_sosc_about.htm|SkinName=webhelp

All Answers

bob_buzzardbob_buzzard

Do you mean a custom list button?  If so, that needs to have a standardsetcontroller for the object rather than the regular standard controller.  You need to define the recordSetVar attribute on the page.

 

 

Pranav_VaidyaPranav_Vaidya

Thanks Bob.

 

Leg is one of the custom objects in my app and I am trying to create a Custom Link Button for this object.

Am I missing something?

 

Thanks.

 

bob_buzzardbob_buzzard

When you get to the create page, which radio button do you choose - Detail Page Link, Detail Page Button or List Button?

Pranav_VaidyaPranav_Vaidya

Hi Bob,

 

I am selecting List button. And the reason for this is my custom object Leg is a child of another object. By choosing as List Button I will be able to show it from my Master-Detail view.

 

Thanks.

bob_buzzardbob_buzzard

List button is different to a detail button though.  In order for your VF page to show up in the list for a Detail Button, it needs to use the standard controller.  However, in order to show up as a list button, it needs to use a standard list controller, as it can potentially receive more than one record.

 

There's more detail at:

 

http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#CSHID=pages_controller_sosc_about.htm|StartTopic=Content%2Fpages_controller_sosc_about.htm|SkinName=webhelp

This was selected as the best answer
Pranav_VaidyaPranav_Vaidya

thanks a lot Bob. changing the StandardController to StandardListController did the job!!

 

Thanks.