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
SN SFSN SF 

This page uses a QueryLocator that is invalid. There is a limit of 50 QueryLocators per user. - VF page Error

Hi ,
I have a VF page that displays bulk records , We have used standard set conroller to implement pagination . At times we receive following error message on  click of "Next "button
"This page uses a QueryLocator that is invalid. There is a limit of 50 QueryLocators per user. "" .

The "Next" button calls below method -
public void next() {        
        if(!readOnly) {
            savenew();        
       }       
        if(Status) {
            setCon.next();
       }
    }



Can someone tell me why do we get this error? and the possible ways to resolve this issue?

Regards,
SN
 
Best Answer chosen by SN SF
AbhishekAbhishek (Salesforce Developers) 
https://salesforce.stackexchange.com/questions/19138/catch-invalid-querylocator-exception/19179

The above developer discussion will answer your query, Go through it and try the method as mentioned.

I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.

Thanks.

All Answers

AbhishekAbhishek (Salesforce Developers) 
https://salesforce.stackexchange.com/questions/19138/catch-invalid-querylocator-exception/19179

The above developer discussion will answer your query, Go through it and try the method as mentioned.

I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.

Thanks.
This was selected as the best answer
SN SFSN SF
Hi Abhishek ,

Thank you , the work around they suggest it worked :)

Thank you once again !

Regards,
SN