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
EricVlachEricVlach 

can't override button. what am I doing wrong?

I have a custom object for which I want to override the standard 'new' button with a visualforce page.

My visualforce page is created, but when I go to override, the page isn't in the list! What step am I missing? I am baffled. This is in my developer edition.

screencast of my steps:
http://screencast.com/t/9yG27DxgouD


Message Edited by EricVlach on 11-13-2008 12:30 PM
JimRaeJimRae
I believe that you can only override a button on an object with a VF page leveraging a standard controller.  It appears you are using a custom controller for your page.  I think you will need to change your page to reference a standard controller, then use a controller extension to add your additional functionality.
 
NodakPaulNodakPaul
I've run into the same problem before.  I have a visual force page whose controller extends a standard controller.  I can override it for any Standard Button except for List.  Am I missing something, is there something special we need to do for List?
dchasmandchasman
To be a valid target for a list oriented override your page must use the standard list controller which is requested using the new for Winter '09 <apex:page recordSetVar> attribute, e.g.

Code:
<apex:page standardController="Contact" recordSetVar="contacts">

See the docs for more info on the standard list controller feature.

dfalsodfalso

I wanted to follow up on this: you actually can get it to stick by first writing your VF page referencing a standard controller, associate it with the override, then change it to use the custom. The override will stick. But of course, since package deployment loses all the overrides (vote for that to change here) it probably doesn't matter in the end. 

 

But this leads to the question: how exactly should we be using custom controllers, if we basically can't use them in VF pages overriding standard actions.

MayeUPAEPMayeUPAEP

Hi,

I know your post is too old, but I don't know if you have solved it.

If you still have the problem, check this link  

http://www.salesforce.com/us/developer/docs/cookbook/Content/vf_conditional_page.htm

It'll help you.   The problem you have is the way you're making your page without this three properties standardController,

extensions and action

Best Regards