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
Priyadarshi NayakPriyadarshi Nayak 

standard list controller to populate all object

Hi 

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 }"/>
              </apex:pageBlockTable>
 </apex:pageBlock>
</apex:page>


Thanks 
Priya
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.

Thanks.
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.

Thanks
Priya
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}" />
</apex:repeat>      
     </apex:pageBlock>
</apex:page>

Please let us know if this will help u