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
tbuckettbucket 

New VF page not in picklist for Custom Button?

I have an easy one for you....I just created one my 1st VF pages, but when I tried to connect to a custom button, it does not show up in the "Content" picklist.  I bet it is something very basic that i am missing!

 

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

To attach a visualforce page to custom button, you need to set the standardcontroller on your visualforce page like this :

 

<apex:page StandardController="Account">
</apex>

And if you have any controller attached with your page you need to do something like this :

 

<apex:page StandardController="Account" extensions="CustomController">
</apex>

 Once you apply StandardController on your visualforce page it will be available in the content picklist to be selected on your custom button.

 

Hope this will help.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

All Answers

kiranmutturukiranmutturu

ya you need to add the standard controller as the respective object on which that you want to place the button..

 

like if you want to place a button on account object then

 

<apex:page standardcontroller="account>... then this will be visible in the buttons list of account object,,

Ankit AroraAnkit Arora

To attach a visualforce page to custom button, you need to set the standardcontroller on your visualforce page like this :

 

<apex:page StandardController="Account">
</apex>

And if you have any controller attached with your page you need to do something like this :

 

<apex:page StandardController="Account" extensions="CustomController">
</apex>

 Once you apply StandardController on your visualforce page it will be available in the content picklist to be selected on your custom button.

 

Hope this will help.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

This was selected as the best answer
tbuckettbucket

Thank you!

Ankit AroraAnkit Arora

If you got your answer then please mark it as solution, so others may get benefit.

 

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page