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
t.deepthi05t.deepthi05 

pagination on single page

Hi All,

I want to display mutiple records on page using pagination.

i want create a next button and on clicking of this button the want display next set of records along with the current records.

Is there any way that I can append the newly fetched records with previous records?


Ajaykumar SadanandeAjaykumar Sadanande
Fetch all the records once and you can play with a bit of javascript logic. 
Gonzalo AbrunaGonzalo Abruna
Hello,

you may find querylocator useful for that: https://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_querymore_querylocator.htm

If querylocator is not enough for your needs, you might want to use OFFSET param in a SOQL statement: http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select_offset.htm

Both ways are good to implement pagination.
nbknbk
Hello,

Following is the sample pagination code. Please have a look.
http://forceguru.blogspot.in/2011/04/pagination-in-salesforce.html
t.deepthi05t.deepthi05
http://forceguru.blogspot.in/2011/04/pagination-in-salesforce.html

This work as normal pagination. when i click next the records have to be displayed with past records 

i.e current page has 5 records when i click next in the same page it has to load new 5 records and previous  5 records total of 10 records 
t.deepthi05t.deepthi05
can i have sample implementation using javascript