How can I get the list of all Lead list views?
Also, how can I get the people from a particular list by means of Apex?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
When you initialize an
ApexPages.StandardSetController with a query on a particular type, you can use the set controller's
getListViewOptions() method to obtain a list (in the form of a
List<SelectOption>) of the list views for that object. The value of each
SelectOption is the Id of a list view that can be passed to
setFilterId() to filter the Set Controller according to that list view's criteria.
Jitendra Zaa has a pretty clear example of how to use this technique.