+ Start a Discussion

standardsetcontroller getlistviewoptions only returning All

I've created a new list view for Contacts and made it available to all Users. When I run .getListViewOptions() it only returns 'All'. I'm also logged in as the admin user. Any idea why no others are showing up?


public class Ctl_CreateContactsForms {

    public ApexPages.StandardSetController setCtrl{get; set;}
    public string filterOption {get;set;}
    public Ctl_CreateContactsForms () {
    	setCtrl = new ApexPages.StandardSetController(Database.getqueryLocator([Select Id,Name FROM Contact]));
	public list<SelectOption> getallListViewOptions () {
		return setCtrl.getListViewOptions();
    // Initialize setCon and return a list of records
    public List<Contact> getcontactList() {
        return (list<Contact>) setCtrl.getRecords();



do you want selected records in your controller?

I'm not sure what you mean. Id like the getAllListVIewOptions to return a list of all the list views.