2

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.

2
  • 1
    Can you elaborate on why you believe the apex code (VF page) for a Standard Object won't work for a Custom Object? What makes the Custom Object special in this regard?
    – Mark Pond
    Jun 24, 2015 at 20:55
  • Hey Mark, here is my apex code that I used on the Account tab. Not sure how to modify it to work with a custom object? <apex:page action="{!URLFOR($Action.Account.List, $ObjectType.Account)}"/>
    – bbrooke
    Jun 24, 2015 at 21:10

2 Answers 2

1

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.

0
0

I have done a similar one in one of my project. I created a visualforce page. Then in that I used an action(attribute on apex:page) to redirect to the URL of list view. To avoid hard coding list view URL, you can keep it in custom label. If you keep standardController attribute as the custom object, users will not feel the difference, other than one second delay in transferring to the list view URL>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .