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
Julie LeszczynskiJulie Leszczynski 

'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
Best Answer chosen by Julie Leszczynski
Alain CabonAlain Cabon
Hello Julie,

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.

User-added image

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

Alain CabonAlain Cabon
Hello Julie,

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.

User-added image

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
This was selected as the best answer
Waqar Hussain SFWaqar Hussain SF
Hi Julie,

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
Julie LeszczynskiJulie Leszczynski
Thank You - Alan, I knew there was a place to find the information, but I couldn't remember how I did it in the past. I will bookmark the page for reference in the future.