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

Custom Pagination for Page block table


I am Retriving the Opportunitylineitem  and  am able to displaying in the Pageblocktable on the page of the curent Products

I have more than 500 records. i am not display on the Page.

i want to keep the Pagination can u please help me

Historicaloppl=[select id,unitprice,PricebookEntry.Product2Id,product__c,PricebookEntry.Product2.Name,Opportunity.Product__r.Id,Product__r.Name,,Purchase__c, PricebookEntryId,ServiceDate,Quantity,Action__c,Vendor__r.Name ,Opportunity.Name,Opportunity.StageName
from OpportunityLineItem where opportunityid!=: and product__c=:userinput.product__c order by unitprice ];


Hey, try to read this one:


Salesforce pagination


You can use either the Salesforce standard controller or use the new OFFSET feature to implement pagination.


When am using the Offset Feature for that Query am not able to keep the Sorting by the unitPrice.It is not working is another method there to do the Pagination.Actually when am using the standard Pagination i m not able to keep for the Opportunitylineitem..........

Can u Suggest me to do another way 

thanks n advances


Any code/examples?