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
Kondal Rao learnerKondal Rao learner 

Regarding pagination and setpagesize

Hi Experts,

Im new to salesforce i got one doubt what is the difference between pagination and setpagesize and when we will go for the pagination and setpagesize, can we use setpagesize for the standardcontroller and customcontroller , please clear my doubts, i dont know whether this question is right or wrong but looking for the right answer.

Thanks in advance
MagulanDuraipandianMagulanDuraipandian
It is applicable only for standardSetController.

If this solves your problem, kindly mark it as the best answer.

Regards,
Magulan
http://www.infallibletechie.com
Kondal Rao learnerKondal Rao learner
Hi Magu,

Thanks for the reply , see my below code once in this setpagesize is used but  we have pagination also why he used pagination over there, what is the difference between pagination and setpagesize, where we can use pagination and setpagesize , can we use setpagenation in standardcontroller please provide me complete detailes about pagination and setpagesize,
1) what is the relation between pagenation and setpagesize
2) when we will go for the pagenation when we will go the setpagesize

Page:
-------
<apex:page standardController="DataLoadTest__c" recordsetvar="recs" extensions="test">
    <apex:form >
           <apex:pageBlock >
                <apex:pageBlockSection >
                    <apex:pageBlockTable value="{!recs}" var="r">
                        <apex:column headervalue="Name">
                            {!r.Name}
                        </apex:column>
                    </apex:pageBlockTable>
                </apex:pageBlockSection>
                <apex:commandButton value="previous" action="{!previous}"></apex:commandButton>
                <apex:commandButton value="next" action="{!next}"></apex:commandButton>
           </apex:pageBlock>
     </apex:form>
</apex:page>

class:
-------
public with sharing class test {
    public test(ApexPages.StandardsetController Controller){
        Controller.setPageSize(2);
    }
  }
Thanks in advance
MagulanDuraipandianMagulanDuraipandian
http://www.infallibletechie.com/2014/03/how-to-get-selected-records-from-list.html

http://www.infallibletechie.com/2013/01/pagination-using-apex-in-salesforce.html

If this solves your problem, kindly mark it as the best answer.

Regards,
Magulan
http://www.infallibletechie.com
Kondal Rao learnerKondal Rao learner
Hi ,

i want difference yaar why we will go for the setpagesize , even we have pagination in my above example why we used the setpagesize , examples ok but im not able to understand what is the exact difference , even one of the itnerview  they asked me, i told them this example , they asked me why you used setpagesize if you have pagination so i dont have answer of it.