You need to sign in to do that
Don't have an account?
Jack Ins
not a valid child relationship name for entity
Hello,
Been working on this too long and need some help. I have a Master Detail relationship between Opportunity and a custom object. I have added the Related list as I have added others to the VF Page but it is giving me the above error. The code is very simple but I must be missing something.
Any help would be great.
Thanks Dwayne
<apex:outputPanel rendered="{!hasPolicy}" id="UpsellCampaignOppt"> <table style="width: 1100px;"> <tr> <td colspan="1"> <apex:pageBlock tabStyle="Campaign"> <apex:pageBlockSection id="UpsellCO" title="Upsell Campaign Opportunities" collapsible="true" columns="1"> <apex:relatedList list="Upsell_Campaign_Opportunities__r" subject="{!policy.Id}"/> </apex:pageBlockSection> <script>twistSection(document.getElementById("{!$Component.UpsellCO}").childNodes[0].childNodes[0]); </script> </apex:pageBlock> </td> </tr> </table> </apex:outputPanel>
Locate the Lookup to opportunity field.
Click the Field name to open the detail.
There should be a field called "Child Relationship Name", we generally add "__r" to this name to render the related list/ or to do a parent to child query
All Answers
Is this is instance of Opportunity ?
Yes. VF page is controlled by apex class the apex class is build based on Opportunity
I have other related lists that work with no problems are set up the same as this object. The only difference is that this object halso has a master detail relationship to Campaigns too.
Here is code of my other related list:
Locate the Lookup to opportunity field.
Click the Field name to open the detail.
There should be a field called "Child Relationship Name", we generally add "__r" to this name to render the related list/ or to do a parent to child query
WOW Not thats interesting. It worked for this. Why would it work for my other related object but differently for this one?
Check the Child Relationship name shomehow they matched.
LOL I like that answer and your right, i got lucky. thanks for your help.