[SalesForce] Redirect to list view URL on custom object tab click

I'm trying to display the "list view" vs "recent item" by default when a tab is clicked on a Custom Object.

I know how to do this for a Standard Object by creating a VF page and applying it to the tab. But the apex code (VF page) for a Standard Object won't work for a Custom Object.

Is there a way I can redirect the URL on a Custom Object tab to the Custom Objects "list view" with either a VF page or S-control? If so can you can you share an example of that redirect URL code?

I appreciate the time and expertise.

Best Answer

You can do the same type of redirect using the same markup and the same edit to the Custom Object's "Buttons, Links, and Actions" Tab config.

If you've got a custom object named Cool_Widget__c you'll just substitute that API name in place of Account in your example.

<apex:page action="{!URLFOR($Action.Cool_Widget__c.List, $ObjectType.Cool_Widget__c)}"/>

Then to override the tab behavior, navigate to Setup > Create > Objects, click on the Cool Widget object's name, scroll down to "Buttons, Links, and Actions" and click edit next to the Tab. Choose the VF option, find your page in the list and click save. Done.

Related Topic