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
UrvikUrvik 

not a valid child relationship name for entity Account

I am getting the following error while trying to put one of my custom object related list on Account Detail page.

 

Content cannot be displayed: 'Application__c' is not a valid child relationship name for entity Account

 

Here is my vf page

<apex:page standardController="Account">
<apex:relatedList list="Application__c"/>
</apex:page>

 I am able to save the vf page but when I put the page on Account details page, its not showing anything but an error.

AdrianCCAdrianCC

Hello,

 

You do not have the correct name for the list.

 

Go to Setup > Create > your custom object, Application. Click on the custom field, the Master-Detail that makes the link to Account. There you will find the real Child Relationship name, should be a plural form without the "__c". Try "Applications"

 

Ty,

Adrian

Avidev9Avidev9

Just to add if the default values were set the vf code should be 

<apex:page standardController="Account">
<apex:relatedList list="Applications__r"/>
</apex:page>

 

UrvikUrvik
Hi Adrian
Its not a master-detail...its a lookup relationship.
UrvikUrvik
I tried to do this but it says URL No Longer Exist. :-(
Alderete_SFDCAlderete_SFDC

<apex:relatedList/> should work with lookup relationship, as well as master/detail relationships

 

  •  Are you certain your relationship is correctly defined?
  •  If you go to a layout for the parent object, is there an option to add the related list for the child object there? (This will verify you have the relationship correct.)
  •  Are you certain you have the correct name for the relationship?

I recommend copy/pasting the relationship name, to make sure you've got it exactly right. @AdrianCC described the path to looking it up.

AdrianCCAdrianCC

Avi is right. the correct name for the list should be

Applications__r

Have you tried it and it didn't work?

 

Happy Thursday,

Adrian

Raveen AvulaRaveen Avula
Thast works Adrian. Thanks !!
Tat Yuen 10Tat Yuen 10
However, check the lookup fields' Child Relationship Name as you may have changed it for better usability. And the suffix is "__r".  I change it all the time as I mostly work with custom objects.