- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
11-09-2012 01:42 PM
I am trying to create a custom button for a VF page. When I do the dropdown I am not seeing my VF page. This VF page is using a custom controller.
I have created a tab for this page.
11-09-2012 03:44 PM - edited 11-09-2012 03:45 PM
It has to use the StandardController for that object and your class needs to just be an extension.
In your Visualforce Page add the StandardController="the object you are referencing" extensions="theClassYouAreReferencing" to the page attributes.
Then you will have to change your constructor in your class to be constructed with the standardController. It will look like the following:
//logic here usually this involves the getRecord method of the standard controller
Certified Salesforce Developer
Check out my blog. http://andrewwilkinsonsf.blogspot.com/
11-09-2012 07:30 PM
If you are creating a brand-new Visualforce tab, then you can use a custom controller for your page and it should be available to create the tab.
If you are adding a custom button to an existing page layout, then Andrew's answer is 100% correct.
If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.