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
Sachin Chaudhary 15Sachin Chaudhary 15 

Related List "pageSize"

Hi,

This is my VF page code. But related list showing all contacts though I am using pageSize="1".

<apex:page standardController="Account">
       <apex:pageBlock>
       <apex:pageBlockSection>
       <apex:detail relatedList="false"/>
            <apex:relatedList list="Contacts" pageSize="1"/>
        </apex:pageBlockSection>
        </apex:pageBlock>
 </apex:page>
Sandy GaliSandy Gali
Yes, It doesnot work . The documentation says it will display 5 records if pagesize is not mentioned and that is not working either.
It is displaying all the contact records
Suraj Tripathi 47Suraj Tripathi 47
Hi Sachin Chaudhary 15,
 
<apex:page standardController="Account">
       <apex:pageBlock>
       <apex:pageBlockSection>
       <apex:detail relatedList="false"/>
            <apex:relatedList list="Contacts" pageSize="1"/>
        </apex:pageBlockSection>
        </apex:pageBlock>
 </apex:page
I just used the code in a test environment without changing anything and it worked perfectly. It seems like this could be a Salesforce bug. You should submit a ticket with Salesforce Support and see if they can provide an explanation

Please mark it as the best answer if it helps you to fix the issue.
Thanks And Regards,
Suraj Tripathi.
Edward Phillips 17Edward Phillips 17
I've contacted Salesforce Support about this and they directed me here, to get it logged as an known issue (the standard support plan doesn't include bug reporting).

This is a visualforce bug, where setting the number of records to display in a related list doesn't work in production. 

In Production:

I set the pagesize to 10.

User-added image

It doesn't work.

User-added image

In Sandbox:

I set the pagesize to 10.

User-added image

And it works.

User-added image