New Way of Pagination
In salesforce there are 2 ways to achieve pagination. 1) Using StandardSetController (Limitation : To instantiate StandardSetController we can query up to 10000 records using query locator. Querying more than 10000 records causes a LimitException to be thrown. However by passing list of more than 10000 records we can instantiate StandardSetController, again holding more records in the List and instantiate StandardSetController can reach heap size. ) 2) Using OFFSET in SOQL query (Limitation : We can skip max 2000 records using OFFSET which means we cannot do pagination by using OFFSET if the query skips more than 2000 records. Skipping more than 2000 records causes "Maximum SOQL offset allowed is 2000 error" . ) Here is a new way...