You need to sign in to do that
Don't have an account?

StandardSetController.getListViewOptions only returning All
Hi,
I am currently trying to retrieve a set of list view options for a Lead object from a StandardSetController. When I look at the SelectOptions that are returned (from getLeadExistingViews) I only recieve the All option in my list. The end result I would like is the list view options for the standard Lead page (All Open Leads etc.) Your help would be much appreciated. Markup and code below.
Gaz
EmailPreferenceAddMembers.page
<apex:page standardController="Email_Preference_Member__c" recordSetVar="members" extensions="EmailPreferenceAddMembersExtensions"> <apex:sectionHeader title="{!$ObjectType.Email_Preference__c.Label}" subtitle="Add Members" /> <apex:form > <apex:outputPanel style="margin-bottom: 1em;" layout="block">« <apex:outputLink value="http://example.org" style="color: #015BA7; text-decoration: none;">Back to Email Preference: My Email Preference</apex:outputLink></apex:outputPanel> <apex:pageBlock > <apex:pageBlockSection title="Step 1: Choose Member Type to Search"> <apex:selectRadio > <apex:selectOption itemLabel="Leads" itemValue="Leads" ></apex:selectOption> <apex:selectOption itemLabel="Contacts" itemValue="Contacts" ></apex:selectOption> </apex:selectRadio> </apex:pageBlockSection> <apex:pageBlockSection title="Step 2: Specify Filter Criteria"> <apex:pageBlockSectionItem > <apex:outputLabel value="Use Existing View" /> <apex:selectList value="{!leadFilterId}" size="1"> <apex:selectOptions value="{!LeadExistingViews}"></apex:selectOptions> </apex:selectList> </apex:pageBlockSectionItem> </apex:pageBlockSection> <apex:facet name="footer"> <apex:commandButton value="Go!" style="margin: 1em; width: 3em;" /> </apex:facet> </apex:pageBlock> </apex:form> </apex:page>
EmailPreferenceAddMembersExtensions.cls
public with sharing class EmailPreferenceAddMembersExtensions { public ApexPages.StandardSetController leadsController {get; set;} public String leadFilterId {get; set;} public EmailPreferenceAddMembersExtensions(ApexPages.StandardSetController controller) { leadsController = new ApexPages.StandardSetController(Database.getQueryLocator([select Id, Name from Lead])); leadFilterId = leadsController.getFilterId(); } public SelectOption[] getLeadExistingViews() { return leadsController.getListViewOptions(); } }
All Answers
Did you ever find a solution to this issue?
Am having the same issue. Did you find a solution?