0

I am overriding the LIST button of account Home page with my own visual force page.

<apex:page standardController="Account"
           recordSetVar="accounts"
           tabStyle="Account"
           sidebar="false">

    <apex:pageBlock >
        <apex:repeat value="{!accounts}" var="a">
            <apex:pageBlockSection title="{!a.name}">
                <apex:relatedList list="Contacts" subject="{!a.Id}"/>
                <apex:relatedList list="Opportunities" subject="{!a.Id}" />
            </apex:pageBlockSection>
        </apex:repeat>      
    </apex:pageBlock>
</apex:page>

In account home page from Picklist, I select All Accounts, then click GO. so the literal meaning of this is it should display all account records. But its not displaying all records only a few.

Is my understanding right or is there something in code that needs to be done?

  • Can you please explain what you are trying to do? – Ratan Paul May 3 '16 at 8:38
  • Are you expecting more than 10000 records? No more than 10,000 records can be returned by a standard list controller. Custom controllers can work with larger results sets. – Pranay Jaiswal May 3 '16 at 8:47
  • Hi, Yes in fact if there are 10000 records it show all the records . But here in my case i have about 5000 records but its not even showing 1/3rd of it. – Krishna Casukhela May 3 '16 at 10:03
2

Your page automatically uses the standard list controller that defaults to using pagination on the data as Pagination with a List Controller explains. So you will need to add a controller extension class that invokes setPageSize (using a large number) on the StandardSetController.

PS

The extension class would look like this:

public with sharing class MyExtension {
     public MyExtension(ApexPages.StandardSetController ssc) {
         ssc.setPageSize(1000);
     }
}

and is added to the page like this:

<apex:page standardController="Account" extensions="MyExtension" ...
| improve this answer | |
  • could u pls show how to add an extension code and set page size? – Krishna Casukhela May 3 '16 at 10:00
  • @KrishnaCasukhela Added example code. – Keith C May 3 '16 at 12:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.