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
ElJefeElJefe 

trouble referencing related child object

How do I reference a child custom object from my Projects object, as I get a "is not a valid child relationship name for entity" when I attempt to reference the related object Expense from project via relatedList.

Best Answer chosen by Admin (Salesforce Developers) 
ElJefeElJefe

<apex:relatedList list="R00N30000001K54TEAS__r"/> works, no idea why for this one object I have to use the Id and not the name but...it works.

All Answers

SurekaSureka

Hi,

 

If the child object has the Master Detail relationship with product, then you can use like below,

 

{!Product2.customs_Object__r} - Please use the Plural label of the child object.

 

Let me know, if that works.

 

Thanks

ElJefeElJefe

'Expenses__r' is not a valid child relationship name for entity Project

 

snippet:

 

 

 

<!--
<apex:page standardController="Projects__c" showHeader="false" renderAs="pdf">  

 <apex:relatedList list="Expenses__r"/>

-->

ElJefeElJefe

<apex:relatedList list="R00N30000001K54TEAS__r"/> works, no idea why for this one object I have to use the Id and not the name but...it works.

This was selected as the best answer