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

Too many query locator rows: 10001



I am fing the following issue while displaying list of records after dynamic search..

I used the following code : 


public ApexPages.StandardSetController Agen{get;set;}


query = 'select id,name,Programme_Name__c from opportunity where ';

    ProgrammeName = userinputData.Programme_Name__c;
    if(ProgrammeName != null && ProgrammeName !=''){
        query = query +'  Programme_Name__c = \''+ProgrammeName+'\'';

 Agen = new ApexPages.StandardSetController(Database.getQueryLocator(query ));




Am getting the error when the count of the records exceeds 10000.If i specify a limit of 10000,then i don't get the error,but i have a list of 35000 records on my object.


Please help me to solve this issue.


Thanks in advance .


Within a Visualforce page, there is a limit of 10,000 rows in a query locator query. You'll have to resort to manual pagination instead of using the Standard Set Controller.