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
amorganamorgan 

How do you use listId in EnhancedList?

Ultimately I'm trying to display a list of opportunities in a paging and sortable way. apex:EnhancedList seemed perfect for what I need, but I can seem to feed it my opportunity list.

 

Page sample: 

<apex:enhancedList listId="MyOppList" height="300"/>

 

Controller sample:

 

public Opportunity[] getMyOppList() {

return [select id, name from Opportunity];

}

 



How do you use listId? All the docs say is "The Salesforce object for which views are displayed"

 

Best Answer chosen by Admin (Salesforce Developers) 
gtuerkgtuerk

From the documentation, you need to navigate to one of the lists views you've created for your object, look at the url in your address bar and strip the leading query param (?fcf=)

 

https://cs1.salesforce.com/a0L?fcf=00B60000005DOph

 

Use the id attribute and set it to that db id

 

so  <apex:enhancedList id="00B60000005DOph" height="300"/>

 

If you're trying to do ad hoc enhanced lists, I think you need to use bind notation ({!boundvalue})

All Answers

gtuerkgtuerk

From the documentation, you need to navigate to one of the lists views you've created for your object, look at the url in your address bar and strip the leading query param (?fcf=)

 

https://cs1.salesforce.com/a0L?fcf=00B60000005DOph

 

Use the id attribute and set it to that db id

 

so  <apex:enhancedList id="00B60000005DOph" height="300"/>

 

If you're trying to do ad hoc enhanced lists, I think you need to use bind notation ({!boundvalue})

This was selected as the best answer
amorganamorgan
Oh I see, yes I got listId to work, but I can't get the EnhancedList to work with bind notation for ad hoc lists. I guess I'll ask that question.