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
Howard IkenHoward Iken 

Creating a VF page to display a related list

I know this has been asked before and I tried my best to follow the previous suggestions.  But I cannot solve this after lots of experimentation.

I created a custom object called Intake Notes that is a child of Contacts.  At first I created a lookup filed based on the Contact Name.  Based on my research I changed that lookup field to a Master-Detail field

I created a VF page with the following code:

<apex:page standardController="Contact">
  <apex:relatedList list="IntakeNotes"/>
</apex:page>

I used the related list name that is displayed in the Master-Detail field:

Child Relationship Name      IntakeNotes

I have tried other related list names as well.

No matter what I do I see the following message in the Contact detail display:

Content cannot be displayed: 'IntakeNotes' is not a valid child relationship name for entity Contact
Best Answer chosen by Howard Iken
Balayesu ChilakalapudiBalayesu Chilakalapudi
Try like this,
<apex:page standardController="Contact">
  <apex:relatedList list="IntakeNotes__r"/>
</apex:page>

All Answers

Balayesu ChilakalapudiBalayesu Chilakalapudi
Try like this,
<apex:page standardController="Contact">
  <apex:relatedList list="IntakeNotes__r"/>
</apex:page>
This was selected as the best answer
Howard IkenHoward Iken
Thank you