function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Patrick DixonPatrick Dixon 

standard list controllers, recordsetvar and filterId

The standard list controller seems to be filtered using the last selected filter for the object, even if it's not applied explicitly in the VF page using the SLC.

 

Is there a way to force it to use a specified filterId when the VF page is called - without having the user select it in the page, or having the last used filter (which could be anything) affect the record set?

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

The standardsetcontroller has a property name 'FilterId' that determines the list view that should be displayed. You can set this by passing the filter id on the URL (much like you can the id for a standard controller).

 

E.g.

 

 

https://kab-tutorial.na6.visual.force.com/apex/RecordSet?filterId=00B80000007mchd

 

 

 

 

All Answers

bob_buzzardbob_buzzard

The standardsetcontroller has a property name 'FilterId' that determines the list view that should be displayed. You can set this by passing the filter id on the URL (much like you can the id for a standard controller).

 

E.g.

 

 

https://kab-tutorial.na6.visual.force.com/apex/RecordSet?filterId=00B80000007mchd

 

 

 

 

This was selected as the best answer
Patrick DixonPatrick Dixon

Many thanks Bob - that's great.

 

.... Actually that should be 'Many thanks Keir' - I should have got the VPP ref as it was one of my favourite series.  Loved the bit when he was forced to drive his wife's FIAT 500 (I think it was) ....

 

I think I am more one of the Nuns rooting around in the dustbin myself.

ErrorProneErrorProne

Hey Bob, FilterId will generate the right listview to my page, however it only shows 25 rows, anyway to have this show 200? 

bob_buzzardbob_buzzard

If you are using an extension controller, you can invoke the standard controller's setPageSize method to change the number of records.

ErrorProneErrorProne

No, I'm working with professional edition. 

 

I was hoping there was a way to do this without through the standard controller. I'm trying to list all assets on a v-force page. is there an easier way to do this? 

bob_buzzardbob_buzzard

Unfortunately not - you need a way to invoke methods on the standard controller to affect the page size.