You need to sign in to do that
Don't have an account?
![Julie Leszczynski Julie Leszczynski](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
'Gaiopps__r' is not a valid child relationship name for entity Account
It has been so long since I needed to update the Tabs on my Account page that I am having trouble with the code. Can you please review my code and let me know why the Object GAI Opportunities is howing the above error.
<apex:page standardController="Account" showHeader="true"
tabStyle="account" >
<style>
.activeTab {background-color: blue; color:white;
background-image:none}
.inactiveTab { background-color: lightgray; color:black;
background-image:none}
</style>
<apex:tabPanel switchType="client" selectedTab="tabdetails"
id="AccountTabPanel" tabClass="activeTab"
inactiveTabClass="inactiveTab">
<apex:tab label="Details" name="AccDetails" id="tabdetails">
<apex:detail relatedList="false" title="true"/>
</apex:tab>
<apex:tab label="Contacts" name="Contacts" id="tabContact">
<apex:relatedList subject="{!account}" list="contacts" />
</apex:tab>
<apex:tab label="Open Activities" name="OpenActivities"
id="tabOpenAct">
<apex:relatedList subject="{!account}"
list="OpenActivities" />
</apex:tab>
<apex:tab label="Activity History"
name="ActivityHistory" id="tabActiHis">
<apex:relatedList subject="{!account}"
list="ActivityHistories" />
</apex:tab>
<apex:tab label="Contracts"
name="Contract" id="tabContract">
<apex:relatedList subject="{!account}"
list="Contracts" />
</apex:tab>
<apex:tab label="Travel History" name="Travel"
id="tabTravHis">
<apex:relatedList subject="{!account}"
list="Travels__r" />
</apex:tab>
<apex:tab label="Opportunities" name="Opportunities"
id="tabOpp">
<apex:relatedList subject="{!account}"
list="opportunities" />
</apex:tab>
<apex:tab label="Cases" name="Case"
id="tabCases">
<apex:relatedList subject="{!account}"
list="Cases" />
</apex:tab>
<apex:tab label="Underwriting & Service" name="Underwriting_Service"
id="tabUndeSer">
<apex:relatedList subject="{!account}"
list="Services__r" />
</apex:tab>
<apex:tab label="GAI Opportunities" name="Opportunities_GAI"
id="tabOppoGAI">
<apex:relatedList subject="{!account}"
list="Gaiopps__r" />
</apex:tab>
</apex:tabPanel>
</apex:page>
Addtionally here is the screen shot from my Relataed To Account field:
![User-added image](/forums/servlet/rtaImage?eid=9060G0000005XxR&feoid=Body&refid=0EM0G0000003SsE)
<apex:page standardController="Account" showHeader="true"
tabStyle="account" >
<style>
.activeTab {background-color: blue; color:white;
background-image:none}
.inactiveTab { background-color: lightgray; color:black;
background-image:none}
</style>
<apex:tabPanel switchType="client" selectedTab="tabdetails"
id="AccountTabPanel" tabClass="activeTab"
inactiveTabClass="inactiveTab">
<apex:tab label="Details" name="AccDetails" id="tabdetails">
<apex:detail relatedList="false" title="true"/>
</apex:tab>
<apex:tab label="Contacts" name="Contacts" id="tabContact">
<apex:relatedList subject="{!account}" list="contacts" />
</apex:tab>
<apex:tab label="Open Activities" name="OpenActivities"
id="tabOpenAct">
<apex:relatedList subject="{!account}"
list="OpenActivities" />
</apex:tab>
<apex:tab label="Activity History"
name="ActivityHistory" id="tabActiHis">
<apex:relatedList subject="{!account}"
list="ActivityHistories" />
</apex:tab>
<apex:tab label="Contracts"
name="Contract" id="tabContract">
<apex:relatedList subject="{!account}"
list="Contracts" />
</apex:tab>
<apex:tab label="Travel History" name="Travel"
id="tabTravHis">
<apex:relatedList subject="{!account}"
list="Travels__r" />
</apex:tab>
<apex:tab label="Opportunities" name="Opportunities"
id="tabOpp">
<apex:relatedList subject="{!account}"
list="opportunities" />
</apex:tab>
<apex:tab label="Cases" name="Case"
id="tabCases">
<apex:relatedList subject="{!account}"
list="Cases" />
</apex:tab>
<apex:tab label="Underwriting & Service" name="Underwriting_Service"
id="tabUndeSer">
<apex:relatedList subject="{!account}"
list="Services__r" />
</apex:tab>
<apex:tab label="GAI Opportunities" name="Opportunities_GAI"
id="tabOppoGAI">
<apex:relatedList subject="{!account}"
list="Gaiopps__r" />
</apex:tab>
</apex:tabPanel>
</apex:page>
Addtionally here is the screen shot from my Relataed To Account field:
For custom objects, look for a pair of entries with the relationship suffix __r:
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_parent_child.htm
If you want to identify Parent and Child Relationships, there is one technique: the "strongest" when you want to see (almost) "all" the available API names in only one XML file.
Setup > quick search: API > click on Generate Entreprise WSDL > button: Generate just one huge file in the browser with all the API names of your org.
Verify all the "__r' elements of your account in the exported entreprise WSDL.
'Gaiopps__r' or something very close (but in the WSDL, the found name is always sure).
Alain
All Answers
For custom objects, look for a pair of entries with the relationship suffix __r:
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_parent_child.htm
If you want to identify Parent and Child Relationships, there is one technique: the "strongest" when you want to see (almost) "all" the available API names in only one XML file.
Setup > quick search: API > click on Generate Entreprise WSDL > button: Generate just one huge file in the browser with all the API names of your org.
Verify all the "__r' elements of your account in the exported entreprise WSDL.
'Gaiopps__r' or something very close (but in the WSDL, the found name is always sure).
Alain
I see the related list i.e. Gaiopps__r which is lookup of account is related to the GAI Opportunities object. You can not use Gaiopps__r list related to account object. You can add the Gaiopps__r list related to GAI Opportunity record.
Regards,
Waqar