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
Hemendra Singh RajawatHemendra Singh Rajawat 

pageSize attribute in <apex:relatedList /> not working


I am facing the issue in pageSize attribute in <apex:relatedList />. Please help me out.

My code - 
<apex:page standardController="Account">
    <apex:detail relatedList="false" />
    <apex:relatedList list="Contacts" pageSize="3"/>
Output - 
User-added image

As you can see in the image in the related list it is showing all the 10 records irrespective of value in pageSize attribute. 

According to the documentation, pageSize is used to define "The number of records to display by default in the related list. If not specified, this value defaults to 5." 

NagendraNagendra (Salesforce Developers) 
Hi Hemendra,

I tried this and it is working for me.May I suggest you please tweak the below code as per your requirement which should help you.
<apex:page standardController="Account">
<apex:pageBlock >
You're looking at some related lists for {!}:
<apex:relatedList list="Opportunities" />
<apex:relatedList list="Contacts" pageSize="6" >
<apex:facet name="header">Titles can be overriden with facets</apex:facet>
<apex:relatedList list="Cases" title="Or you can keep the image, but change the text"
Please let us know if this helps.