+ Start a Discussion
Priyadarshi NayakPriyadarshi Nayak 

standard list controller to populate all object


standard list controller populate object list contains objects created recently. What setting is required to list all objects?

e.g following code only shows recently created objects.

<apex:page showHeader="false" sidebar="false" standardController="Account" recordSetVar="accounts">
<apex:pageBlock title="Contacts List">
    <apex:pageBlockTable value="{! accounts }" var="a">
                <apex:column value="{! a.Name }"/>
                <apex:column value="{! a.Phone }"/>

Ajay K DubediAjay K Dubedi
Hii Priyadarshi Nayak,

Since you are using standard controller for displaying page so it uses the standard functionality of salesforce, which by default displays the 20 records on the page.
If you want to display more number of records than you can use pagination or can use controller with the page.

Priyadarshi NayakPriyadarshi Nayak
Hi Ajay
Thanks for your reply.
I suppose, you have not got my question.

My question is not related to no of records standard controller displays. It is displaying only recently created records. e.g. There are arounf 15 Account records. But when I use standard list controller in vf page, it display only 1 record. i.e. records created recently.

So how can I diplay all the 15 records.

Amit Chaudhary 8Amit Chaudhary 8
Please try below code. I hope that will help u
<apex:page standardController="Account" recordSetVar="accounts" tabstyle="account" sidebar="false">
    <apex:pageBlock >
          <apex:repeat value="{!accounts}" var="a">
<apex:pageBlockSection title="{!a.name}"></apex:pageBlockSection>
  <apex:relatedList list="Contacts" subject="{!a.Id}"/>
<apex:relatedList list="Opportunities" subject="{!a.Id}" />

Please let us know if this will help u