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
KnowledgeseekerKnowledgeseeker 

Help??? Add the "view list" link to the top left of custom VF pages.

Hi,

 

There is a link that will take you back to your object view list when you have clicked into an object record. It is located on the top left hand page of your record. I have created custom visual force pages and I'm not sure how to re-create this standard salesforce pages functionality in my custom VF pages. Any help is greatly appreciated. Thank you in advance - Jeremy

joshbirkjoshbirk

Are you trying to link back to the standard list view from a custom visualforce page, or replicate the standard list view in a new custom visualforce page?

KnowledgeseekerKnowledgeseeker

your first answer...I'm trying to link back to the standard list view from the custom visualforce page.

joshbirkjoshbirk

Ah, good.  That's much easier :)

 

Any list view URL can be created if you know the prefix of the object.  It will be:

 

https://na#.salesforce.com/prefix

 

With "na#" being your pod naturally, and prefix being the prefix of the object.  So "https://na7.salesforce.com/003" brings up the default list of Contacts in one of my orgs.  But since VF can just use related URL's, you really just need the prefix.

 

To do this programmatically, you can use describe.  So something like:

String url = '/' + Contact.sObjectType.getDescribe().getKeyPrefix();

 And url could be used on a link to get to the list page.