I am trying to limit an apex:relatedList to one record by setting pageSize=1, but it is showing all of the related records. Can anybody tell me what is the issue? Here is my code:

<apex:page standardController="Account">

    <apex:pageBlock >    
          <apex:detail relatedList="false"/>
          <apex:relatedList list="Contacts" PageSize="1"/>
          <apex:relatedList list="Opportunities"/>

  • what is the issue you are facing?
    – Ratan Paul
    Commented Feb 2, 2016 at 11:32
  • in related list it will show me more than 1 record (total 7 Contacts are there)
    – Nihar
    Commented Feb 2, 2016 at 11:33
  • @Nihar so the issue is that it is displaying 7 records under contacts instead of one? Commented Feb 2, 2016 at 17:00
  • Yes. correct @BlairKristin
    – Nihar
    Commented Feb 3, 2016 at 4:54
  • I'm going to guess that this page is meant to be an override to the standard Account detail page. Did you actually override the View button to be this new page and verify that when you click on any Account link, that the VF page actually appears in the URL?
    – cropredy
    Commented Feb 9, 2016 at 5:30

1 Answer 1


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.

  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review Commented Feb 9, 2016 at 2:01
  • @Boris Bachovski I felt like it was an answer because he is asking why the attribute "Page Size" isn't working for him and he is asking what the issue is. The answer is that there isn't an issue with the code. The code works completely fine. This issue needs to be addressed by Salesforce Support. I can remove it as an answer if that is what the community would prefer, but he asks what the issue is with his code and the answer is nothing. Commented Feb 9, 2016 at 15:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .