+ Start a Discussion
turbo2ohturbo2oh 

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]));
 		setCtrl.setPageSize(5); 		
    }  
	
	public list<SelectOption> getallListViewOptions () {
		system.debug('setCtrl.getListViewOptions()'+setCtrl.getListViewOptions());
		return setCtrl.getListViewOptions();
	}
	
    // Initialize setCon and return a list of records
    public List<Contact> getcontactList() {
        return (list<Contact>) setCtrl.getRecords();
    }
}

 

hitesh90hitesh90

do you want selected records in your controller?

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