+ Start a Discussion
Abhilash Gupta 21Abhilash Gupta 21 

How to display more than 2000 records from a list view using standard set controller in Lightning?

Hi All,

How to display more than 2000 records from a list view using standard set controller in Lightning component?
The default setPagesize limit is 2000.

Thanks,
Abhilash
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Abhilash,
 
public static final String DESIRED_LISTVIEW_LABEL = 'All';
public SomeClass(ApexPages.StandardSetController controller)
{
    if (!controller.getSelected().isEmpty())
        return [SELECT Name FROM MyObject__c WHERE Id IN :controller.getSelected()];
    for (SelectOption listViewOption : controller.getListViewOptions())
    {
        if (listViewOption.getLabel() == DESIRED_LISTVIEW_LABEL)
        {
            controller.setFilterId(listViewOption.getValue());
            break;
        }
    }
    // do stuff
}

Please refer the below link for reference. I hope it will be helpful.

Please mark it as best answer if the information is informative.

Best Regards
Rahul Kumar