Posts

Showing posts with the label Pagination

Salesforce Pagination Technical Explanation

Pagination is used to display a list of records from an object in salesforce using standardset controller, Once you done setting up  standardController  attribute then you need to set attribute value to  recordSetVar  attribute value on the same component. recordSetVar  indicates the page uses a list controller. Also we need to use ‘ApexPages.StandardSetController’ in controller extension constructor for inheriting prebuilt salesforce standard object functionality. Now we can see an example on Pagination, Apex Class:- In the below Class, i am getting list of records in constructor using salesforce api method getRecord() and doing an explicit type casting to Account object ‘(Account)controller.getRecord()’ Then in ‘accountRecords’ getter method i am forming a query inside Database.getQueryLocator method which will return me list of accounts whose opportunity is not closed. Again using getAccountPagination() getter method i am retrieving ...