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
VarunCVarunC 

How to use setFilterID in custom controller APEX class

Hi,

I'm using this code to set View Filters but it is not working:
Code:
List<Contact> ct = [Select AccountId, Id, Title, Phone, OwnerId, Name, MailingCity, LastName, FirstName, Email, Account.Name From Contact Order By LastName, FirstName];
ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(ct);
ssc.setFilterID('00B80000005xfRxEAI');
contacts=(List<Contact>)ssc.getRecords();


but contacts is still having all CONTACTS list records.

Can anyone provide me with some sample code with Custom list View Options working? Or shed some light on what IS Needed to be Done to make it working.

Thanks.





Message Edited by vchaddha on 11-28-2008 08:51 AM
talgiladitalgiladi

Hi,

Did you manage with the filterId?

I know the filter id is the id of a list view control, but did you find a way to pass the id of a specific view in order to filter the contacts?

 

Thanks!