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
Allen MoyAllen Moy 

Unable to get Related List

I have two custom tables Produce_Order__c is a parent to Produce_Order_Item__c.

If I put in the <apex:detail /> component. I see the related list for the child records. If I put in <apex:relatedList > I get a Visualforce Error that it is not a valid child relationship name for entity Produce Order. I have tried a dozen different options for <apex:relatedList list="Child LIst" > with always the same error. 

Here is a snippet of my code.

<apex:page standardController="Produce_Order__c" sidebar="false" >
    <apex:sectionHeader title="{!Produce_Order__c.Name} - {!Produce_Order__c.Pickup_Date__c}" subtitle="{!Produce_Order__c.Pickup_Site__r.Name}" />
    <apex:pageBlock title="{!Produce_Order__c.Farmers_Market_Producer__r.Name}" >
        <apex:pageblockSection columns="1">
            <apex:relatedList list="Produce Order Items"/ >
        </apex:pageblockSection>
    </apex:pageBlock>
</apex:page>

Thanks!
Best Answer chosen by Allen Moy
Deepak Kumar ShyoranDeepak Kumar Shyoran
You are getting this error because you are providing you child relationship label which is not excepted rather you have to provide child relationship API name which you can find from Child Object by clicking on Parent Object field (Lookup/Master).

So the Child Relationship name is  TestObjs__r in following case

User-added image

All Answers

Abhishek_PareekAbhishek_Pareek
This article might be helpful for getting the related list for you:

https://www.salesforce.com/us/developer/docs/pages/Content/pages_quick_start_custom_mapping.htm
Deepak Kumar ShyoranDeepak Kumar Shyoran
You are getting this error because you are providing you child relationship label which is not excepted rather you have to provide child relationship API name which you can find from Child Object by clicking on Parent Object field (Lookup/Master).

So the Child Relationship name is  TestObjs__r in following case

User-added image
This was selected as the best answer