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

How to designate default/initial list view for enhancedlist component

I want to include the apex:enhancedList component on a VF page. I want this page to display a particular view when the page first loads. How can I do this? I won't know the specific IDs of any records because this code will be installed in other orgs.


Can I query for a particular view and designate that the enhancedList should show that view?


Can I specify that a particular view should be displayed by name?

Best Answer chosen by Admin (Salesforce Developers) 
Hi, I need to do the same thing....designate a default/initial list view for enhancedlist component. Is this possible? Thanks, Alan

All Answers

Hi, I need to do the same thing....designate a default/initial list view for enhancedlist component. Is this possible? Thanks, Alan
This was selected as the best answer

I need the same the same thing. Is there a solution for that? I can not see.




I have found a way which will work.


A) Find out the listview ID

1. Go to the object's tab and load the listview which you want to use as default.

2. In the header of the standard listview (not in an enhancedList on a visoualforce page!) there is a print preview icon. Get its print preview call into the clipbboard (right mouse button click on the icon; Copy Shortcut)

3. Paste it in an editor. It looks like this:


4. You have the ID you need as an fcf parameter.


B) Build the listview call


1. Sometimes you can see a link on standard detail salesforce pages like

Back to List: Solutions

You can get such a link-example with Copy Shortcut, like this:

2. Build a similar https-string together using the proper object characteristics (3 characters) and using the listview ID you need.

3. Use this https-string in your code.







Awesome, thank you. 


Anyone have any idea how to specify this in a VF page?  I've looked through the tags for ListView as well, and it doesn't like me trying to specify.


You can do this by overriding the tab with a VF page that then redirects you to a certain list view.


  1. Create a new VF page "LeadTab".  In the action tag, paste the link you see in the browser while you are viewing the listview - here I've used a Lead list view that I created.  Make sure that list view is visible to all users otherwise people will get errors when they click on the tab.  tabStyle is the object name or custom_object_name__c.
    <apex:page tabStyle="Lead" action="/00Q?fcf=00B30000002DRKa&rolodexIndex=-1&page=1" >
  2. Set security on this VF page so everyone can see it.
  3. Override the Lead tab by going into Customize -> Lead -> Buttons and Links (or in the Object definition under Create -> Object if you are doing this for a custom object).  Select your newly created VF page above.
  4. Clicking the Lead tab will flicker as it goes to your VF page and then immediately to the specified list view above.

Hope that helps!