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
dwright01dwright01 

Why is the Content dropdown empty when I try to create a custom button on the Account detail page?

I'm in a sandbox and trying to create a Detail Page Button on the Account page that opens my new VisualForce page.  I've created the page in Developer Mode by navigating to "/apex/newpagename" and clicking "Create the page".  It is the default page created by doing this  ("Congratulations  This is your new Page: newpagename").  

 

Then I went to Customize / Accounts / Buttons and Links and clicked the New button to create a new Custom button, and selected Content source = VisualSource page.  According to the instructions in the VisualForce workbook I should then be able to choose my page in the "Content" dropdown.  But, the dropdown is empty.

 

What am I missing?

 

Thanks, Dave

Best Answer chosen by Admin (Salesforce Developers) 
aballardaballard

I can't think of anything you can do with a custom controller that you can't do with a standard controller + custom extension. 

 

 

All Answers

dwright01dwright01

I've got more information for this.  You will see a page in the drop-down if you have <apex:page standardController'="Account">.   But, you will not see a page that has <apex:page controller="apexclass">, although you can specify that first page, then change the page to specify it uses your custom controller later.

 

aballardaballard

Don't do that.  Use a standard controller as is expected.   Add a custom extension to do whatever custom processing you want. 

 

(Being able to change the controller type after you create the custom button is a bug and highly likely to stop working in future and/or cause other problems.)

dwright01dwright01

I don't see that this would always be acceptable.  Certainly there are use cases where a custom controller is called for, aren't there?

aballardaballard

I can't think of anything you can do with a custom controller that you can't do with a standard controller + custom extension. 

 

 

This was selected as the best answer