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

Create "Back to List" Link on Visualforce Detail Page


I put an override on the "View" link for one of my custom objects. I'm sending people to a custom Visualforce page when they choose to View a record from a list view. I am trying to re-create the record detail page in Visualforce and want to put a "Back to List: [Object Name]" link right under the sectionHeader - just like you would see on a standard record detail page. I think you can do this using the "apex:commandLink" component, but cannot figure out what the correct syntax is. Does anyone know how to do this in Visualforce?


You do not need commandLink if you do not want to post any data back to the server, use:
<apex:outputLink value="/{!MyObject.Id}">Back to List</apex:outputLink>




Did you find a solution for this issue? We are having the same problem here.




Did anyone get this working to appear the same as standard layouts?

I used $Page on my detail page to create a link back to the list page:
<apex:outputLink value="{!$Page.[name of your visualforce page]}">Back to list</apex:outputLink>

sheetal kawalesheetal kawale
The following link works on visualforce page - To add custom link "Back To List".  
<apex:outputLink  value="{!URLFOR($Action.Case.List, $ObjectType.Case)}"> « Back to List: Cases</apex:outputLink>

sheetal kawalesheetal kawale
Following link with proper CSS.
<apex:outputLink value="{!URLFOR($Action.Case.List, $ObjectType.Case)}" style="color: rgb(1, 91, 167);
font-family: 'Verdana','Geneva',sans-serif;font-size: 10.95px;text-decoration: none;text-decoration-color: rgb(1, 91, 167);text-decoration-line: none;text-decoration-style: solid;"> « Back to List: Cases</apex:outputLink>

Jayshanker NairJayshanker Nair
Thanks , this works :)