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
sarbpreet kaur 12sarbpreet kaur 12 

Is there a way to apply pagination on nearly 400k records?

I need to apply pagination on nearly 400k records in a VF page. Is there a way to do that?
Saurabh Sood 12Saurabh Sood 12
Yes, but how u want to access each page 1) one by one page  2)give a page number and access bunch of records
jigarshahjigarshah
Sarbpreet,

The links below should help you identify the different techniques available for pagination and will help you determine the most apt technique for paginating over large sets of data
  • https://developer.salesforce.com/page/Paginating_Data_for_Force.com_Applications
  • https://developer.salesforce.com/blogs/tech-pubs/2012/06/the-joys-of-soql-pagination.html
  • https://th3silverlining.com/2010/04/21/client-side-visualforce-pagination-with-pajinate/
Please mark the thread as SOLVED and asnwer as the BEST ANSWER if it helps address your issue.
sarbpreet kaur 12sarbpreet kaur 12
Hi Saurabh. I want to access each page one by one by clicking on the next button.
sarbpreet kaur 12sarbpreet kaur 12
Hi jigarshah. I went through below link provided by you. It mentions query and querymore for paginating using Java with just a sample code written in java. Could you please let me know how to implement this in salesforce?
https://developer.salesforce.com/page/Paginating_Data_for_Force.com_Applications
jigarshahjigarshah
Sarbpreet,

You can leverage the querymore() and query() calls using callouts from Apex ( Use Http, HttpRequest and HttpResponse classes) or Javascript and then parsing the JSON response.

Hope that helps.
Sarb TestSarb Test
Hi Jigarshah.. Do you have any implemented code using querymore() and query()?