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

Possible bug using getListViewOptions in StandardSetController?
There's either a bug with the platform, or with the developer (me). The following code yields a system crash:
public ApexPages.StandardSetController leadSet { get { if(leadSet == null) { leadSet = new ApexPages.StandardSetController(Database.getQueryLocator([select id, name from Account where id=null])); List<SelectOption> lvl=leadSet.getListViewOptions(); system.debug('size: '+lvl.size()); // Fail is here } return leadSet; } set; }
What I'm trying to do is fetch a list of possible filter IDs, and set the filter ID to something, just so there's some initial valid value. However, anytime I try to do any list-type things to my SelectOption list returned from getListViewOptions, I get a crash. I can't call size() or for-loop iterate. I can't even do lvl[0]. Just shuts the whole thing down with the "Internal Server Error."
Am I doing something completely wrong here?
I agree. I also can't get the getListViewOptions method to work in my testmethod. I have about 6 Lead views and I can't determine what the getListViewOptions is returning...it doesn't look like a list of selectOptions. Each time I run the test, I get different values after the "@". But, I do have a filterId set.
According to http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_pages_standardsetcontroller.htm this should return a list of SelectObjects.
Hi Brian,
Thanks for your post, i am getting the list view id's from object records. Now in the same way i need to display the records when we select the listview from visualforce page. How can i use the query for getting records of object through listview id.
Please help me its very urgent.
Thanks,
Lakshmi.
http://boards.developerforce.com/t5/Visualforce-Development/StandardSetController-getListViewOptions-only-returning-All/td-p/462971