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
sg_7sg_7 

'NotesAndAttachment' is not a valid child relationship name for entity Account

Hi, The below code through a error" 'NotesAndAttachment' is not a valid child relationship name for entity Account" and i have one custom object but i don't no how it display.And the below code execute in 28.0 version,but not execute in 29.0 ,why?

 

<apex:page standardController="Account" showHeader="false"
tabStyle="account" >
<apex:stylesheet id="customstylesheet" value="customstylesheet"/>
<style>
.activeTab {background-color: yellow; color:red; font-format:italic;font-size:19pt;
background-image:none}
.inactiveTab { background-color: lightgrey; color:black;
background-image:none}
</style>
<apex:tabPanel switchType="client" selectedTab="tabdetails"
id="AccountTabPanel" tabClass="activeTab" >
<apex:tab label="Details" name="AccDetails" id="tabdetails" >
<apex:detail relatedList="true" title="true" />
</apex:tab>
<apex:tab label="Contacts" name="Contacts" id="tabContact" style="customstylesheet">
<apex:relatedList subject="{!account}" list="contacts" />
</apex:tab>
<apex:tab label="Opportunities" name="Opportunities"
id="tabOpp">
<apex:relatedList subject="{!account}"
list="opportunities" />
</apex:tab>
<apex:tab label="Open Activities" name="OpenActivities" styleClass="newlink"
id="tabOpenAct">
<apex:relatedList subject="{!account}"
list="OpenActivities" />
</apex:tab>
<apex:tab label="Notes and Attachments"
name="NotesAndAttachments" id="tabNoteAtt">
<apex:relatedList subject="{!account}"
list="NotesAndAttachment" />
<apex:tab label="customobject" name="customobject">
<apex:relatedList list="customobject__r"/>
</apex:tab>
</apex:tab>
</apex:tabPanel>
</apex:page>

 

thanks

Ramesh

Dhaval PanchalDhaval Panchal

Instead of below
<apex:relatedList subject="{!account}" list="NotesAndAttachment" />

try below
<apex:relatedList subject="{!account}" list="NotesAndAttachments" />

santhoshgsanthoshg

Thank You very much.

One more thing in this code i have one custom object but it through same error lik"Loans__r is not a valid child relationship name for entity Account"

 

Thanks

Ramesh

Dhaval PanchalDhaval Panchal
Loans is lookup field? if yes then use {!Loan__c}
santhoshgsanthoshg

Hi,

 

It is normaly executed but,if i give record id in the url like"https://na15.salesforce.com/apex/standardobjectdetails?id=001i000000Swpl5" it through a errors like 'loan__c' is not a valid child relationship name for entity Account" and also notesandattachent.

 

 

Thanks

Ramesh

ezdhanhussainezdhanhussain
Use <apex:relatedList subject="{!account}" list="CombinedAttachments" />