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

ApexPages.StandardSetController in lightning (filterId)
public void refreshOptyList(){ list<Opportunity> testList = new list<Opportunity>(); optyList.clear(); tooManyResults = false; if (filterId <> null && filterId<> 'None'){ optySetController.setFilterId(filterId); 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)); counter++; if (counter == 999){ tooManyResults = true; break; } } }
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 //refreshOptyList(); }
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.
- https://salesforce.stackexchange.com/questions/63962/standardsetcontroller-is-returning-no-results-when-using-setfilterid-even-thoug
Hope this helps.Kindly mark this as solved if the reply was helpful.
Thanks,
Nagendra