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

Overriding the standard links for the default list on a custom object

Hi. Hopefully there is a simple solution.

I have created a custom object. When the user clicks on the tab for the custom object, the default list of items created for that object is displayed.

By default, when the user clicks on the link that directs them to the detail for the selected custom object. I want to change this so that the user gets redirected to a custom page I have built, which has a custom controller as well. I looked at doing it with a S-Control that pointed to the custom page but can't get see my custom page in the selection. From what I have read it looks like that  my custom page needs to use a non-custom controller if I want to do this.

Is this correct? Is there a work around I can use?

Many thanks.
To override a standard action with a VF page, the page needs to be defined to use the standard controller that is apppropriate to the action.  In the case of a custom object, this would be standardController="myobjectname__c" .
Thanks for this. Perhaps I am doing something wrong, but whenever I try to change the controller name the system prompts me with a message saying that the controller doesn't exist (even though I changed the name in the controller as well). But when I click on the link to create the controller nothing happens.

I have tried creating a brand new custom page and calling the controller "myobjectname__c"  (substitute myobjectname for whatever the custom object is called). The system again prompts me that no controller is created. When I click on the link to create the controller nothing happens.

Am I doing something wrong?
Sounds like you are specifying controller=... instead of standardController=...    
Even though its a custom object, you want to use the standard controller for it.
Ah. I see. Unfortunately, I need to use a custom controller (heaps of logic being used behind the scenes). Is there anyway I can override the standard list under these circumstances? Is there a work around?

Use the standard controller with a custom extension.
Thanks for this. I tried it and when prompted with the link to create the extension class I receive a system error message (notifying support). I guess maybe the Extensions are still a work in progress.
Can you elaborate the steps that you used that resulted in the error message?  If there is an issue we'd like to get a bug on it and get it fixed.

I created my page
<apex:page standardController="customObject__c" extensions="myExtension">


It prompted me to create the extension and it worked, so I want to verify if you are doing anything differently that might help me reproduce that case.

Also, you can always create the class through setup and then refer to it in your extensions attribute, if the quick fix is acting funny.

Message Edited by Tran Man on 02-21-2008 10:47 AM
I don't think I have done anything different but I am no longer getting the error message. I just have to use the setup option rather than the quick fix.

Thanks for your help.
Hello AB,
Were you able to override the standard link to redirect the user to your custom VF page?
I have a standard Controller class for the Custom Object but i am not sure how and where can i override the standard link with this VF page?
Please help!!