You need to sign in to do that
Don't have an account?

Display Related List information from a Master Detail Relationship
I am trying to finish my Visual Force page with the presentation of Related List information. I have the Standard Object (Account) and Custom Object (Account Document) in a Master Detail scenario as stated in Schema Builder: Master-Detail Relationship from AccountDocument to Account. The AccountDocument Related List is successfully displayed on my Account Page Layout.
When I am on my VF Page I can successfully add the Related List for Contacts but when I go to add the Related List information for AccountDocument, I get error messages but no matter my approach. One example of an error message: Visualforce Error: 'AccountDocument__r' is not a valid child relationship name for entity Relationship. Again, this is one example of a method I have used to try and get the information displayed. Am I trying to display infomation that cannot be displayed?
Thank you in advance for any insight that you could provide.
When I am on my VF Page I can successfully add the Related List for Contacts but when I go to add the Related List information for AccountDocument, I get error messages but no matter my approach. One example of an error message: Visualforce Error: 'AccountDocument__r' is not a valid child relationship name for entity Relationship. Again, this is one example of a method I have used to try and get the information displayed. Am I trying to display infomation that cannot be displayed?
Thank you in advance for any insight that you could provide.
Hi Chris, I guess you might be going wrong with the child relationship name usually relationship names will be plurals eg:- 'AccountDocuments__r'.
Once go to the lookup field and check the childrelationship name.
You should be using "Child Relationship Name" in <apex:relatedlist list=""/>
Ex: if your Child Relationship Name = AccountDocument then syntax is “AccountDocument__r” I believe your relationship name is “AccountDocuments” and you are missing "s".
Hope this helps
Thanks
Pradeep
Visualforce Error 'AccountDocuments__r' is not a valid child relationship name for entity Relationship.
Two additional clues: On the custom object page, I am seeing the Relationship as Master-Detail. As far as you know, should I still be able to do this with Master-Detail Relationships? If so, any thoughts on why this would be not cooperating? Thanks!!
Hi Chris, You can do it for Master-detail as well but it might not be plural for that how ever it's all depends on the relationship name you have given.
Coming to your point you said that you are calling VF page through button from Account layout ? is it via URL button or button over rided with visualforce page ? if it is URL button are seding Account Id as parameter value ?
Would you be able to post your code here it would be more helpful.
<apex:page sidebar="false" showHeader="false" standardController="Account" renderAs="pdf">
<img src="{!URLFOR($Resource.Logo)}" width="400px;"/>
<apex:pageBlock title="Hello Valued Customer!">
You are viewing a document status report for the following Relationship: <b> {!account.name}</b>
<p> This information is current as of {!TODAY()}</p>
<p> This report was produced by: {! $User.FirstName & ' ' & $User.LastName &", "& $User.Title }</p>
</apex:pageBlock>
<apex:pageBlock title="Contacts">
<apex:pageBlockTable value="{!account.Contacts}" var="contact">
<apex:column value="{!contact.Name}"/>
<apex:column value="{!contact.MailingCity}"/>
<apex:column value="{!contact.Phone}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
Thanks fagain for your help.