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
Norah Ward 6Norah Ward 6 

How to get the listview ID?

Hello all,

I'm working for an NFP organisation whe want to see two tabs for the two account record types. They are using classic so I figured I'd just do two VF tabs. However , using both id and listId provides me with nothing. I have created the following:
<apex:page >
    <apex:enhancedList type="Account" height="700" rowsPerPage="100" listId="{!Household_Accounts}" />

However, I'm pretty sure it needs a record ID but Salesforce no longer creates separate record ID's for each list view... what to do?
Sathish balajiSathish balaji
Hi Norah,
Salesforce creates seperate record ID for each list view  and stores it in the object "ListView". Fetch the ID of the listview you want from this object and hardcode it in listId attribute.

When you use listId attribute, type attribute can be optional as we directly provide the id.

Note : Use 15 digit salesforce ID of the list view. 
<apex:page >
<apex:enhancedList id="list" listId="00B2800000ApaMY" height="200"/>

Best Regards,
Sathish Balaji