+ Start a Discussion
Thiago Barbosa 1Thiago Barbosa 1 

ApexPages.StandardSetController in lightning (filterId)

public void refreshOptyList(){
    list<Opportunity> testList = new list<Opportunity>();
    tooManyResults = false;
    if (filterId <> null && filterId<> 'None'){
        testList = (list<Opportunity>)optySetController.getRecords();
        searchPerformed = true;
    }else searchPerformed = false;
    System.debug('Filter used=>'+filterId);
    System.debug('Result #=>'+ optySetController.getResultSize());
    Integer counter = 0;
    for (Opportunity opty:testList){
        optyList.add(new cOpty(Opty));
        if (counter == 999){
            tooManyResults = true;
public MassReassignOpportunitiesController(){
    //Variable Init
    optyQueryString = 'SELECT name,StageName,Ownerid, Owner.Name, CloseDate from Opportunity where isDeleted=false';
    optyList = new List<cOpty>();
    optySetController = new ApexPages.Standardsetcontroller(Database.getQueryLocator(optyQueryString+' limit 1000'));
    filterId = listviewoptions[0].getValue();
    searchRecord = new Opportunity();
    helperRecord = new Reassign_Helper__c();
    isSuccess = true;
    searchPerformed = false;
    tooManyResults = false;
	isLightning = false;
    mapErros = new Map<String, String>();
    //Apply the default filter

NagendraNagendra (Salesforce Developers) 
Hi Thiago,

Sorry for this issue you are encountering.

May I suggest you please check with below link from the stack exchange community exactly with a similar discussion which should help. Hope this helps.

Kindly mark this as solved if the reply was helpful.