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
JJenkinsJJenkins 

Tabbed Accounts/ Related Lists

I'm trying to tab out our account layout.  I'm unable to create a tab for some related lists that are standard objects (Partners, Content Deliveries, Activity History, etc)  The custom objects were no problem, but for these and a few other standard objects I receive the "not a valid child relationship error"

 

here is the code I'm using - taken from the infamous tabbed accounts in 30 seconds wiki

 

<apex:tabPanel switchType="client" selectedTab=" tabdetails" id="AccountTabPanel" tabClass="activeTab" inactiveTabClass="inactiveTab">   
      <apex:tab label="Contacts" name="Contacts" id="tabContact">
         <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" 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="NotesAndAttachments" />
      </apex:tab>
       <apex:tab label="Activity History" name="Activity History" id="tabActivityHistory">
         <apex:relatedList subject="{!account}" list="ActivityHistory" />
      </apex:tab>

 

 

I've searched through the boards here and was unable to locate an answer for standard objects only custom.

 

Any help would be appreciated.

 

Thanks,

 

 

Ispita_NavatarIspita_Navatar

 I think there may be an issue with they "relationship name" that you have specified. I would suggest you go into the defintion and make sure that you are specifing the exact "Child Relationship Name".

I suggest use the schema explorer of Ecllipse to find out the exact relationship name- I think the relationship name for "Activity History" is "Activity Histories".

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.

JJenkinsJJenkins

Is there a way to find the correct name without Schema Explorer?

 

I have no idea what that is.

Brothe2000Brothe2000

Here is the Custom Tabs I built out.  I have Partners as a separate tab but I stacked the Activities all under one tab so you have the Open Activities on top of the Activity history.  I don't know about Content Deliveries.

 

 

    <apex:tabPanel switchType="client" selectedTab="tabdetails"
                    id="AccountTabPanel" tabClass="activeTab"
                    inactiveTabClass="inactiveTab">
        
        <apex:tab label="Account Info" name="AccInfo"
                id="tabAccInfo">
           <apex:detail relatedList="true" title="true"/>

        </apex:tab>
        
       
        <apex:tab label="Contacts" name="Contacts"
                id="tabContacts">
            <apex:relatedList subject="{!account}"
                                list="Contacts"  />
            <apex:relatedList subject="{!account}"
                                list="AccountContactRoles"  />                                                       
        </apex:tab>
 
        <apex:tab label="Opportunities" name="Opportunities"
                id="tabOpp">
            <apex:relatedList subject="{!account}"
                                list="Opportunities"  />
        </apex:tab>    

        <apex:tab label="Activities" name="Activities"
                id="tabAct">
            <apex:relatedList subject="{!account}"
                                list="OpenActivities"  />
            <apex:relatedList subject="{!account}"
                                list="ActivityHistories"  />
        </apex:tab>   

        <apex:tab label="Cases" name="Cases"
                id="tabCases">
            <apex:relatedList subject="{!account}"
                                list="Cases"/>
        </apex:tab>

        <apex:tab label="Docs/Notes" name="Documents"
                id="tabDocs">
            <apex:relatedList subject="{!account}"
                                list="NotesAndAttachments"  />
        </apex:tab> 




        <apex:tab label="Implementations" name="Implementations"
                id="tabImps">
            <apex:relatedList subject="{!account}"
                                list="Implementations__r"  />
        </apex:tab> 
          

        <apex:tab label="Contracts" name="Contracts"
                id="tabContract">
            <apex:relatedList subject="{!account}"
                                list="contracts"  />
        </apex:tab>




               
        <apex:tab label="Projects" name="Projects"
                id="tabProjs">
            <apex:relatedList subject="{!account}"
            list="Projects__r"  />
        </apex:tab>

        <apex:tab label="Partners" name="Partners"
                id="tabPartners">
            <apex:relatedList subject="{!account}"
                                list="AccountPartnersFrom"  />
        </apex:tab>

         
        <apex:tab label="Service Credits" name="ServiceCredits"
                id="tabCreds">
            <apex:relatedList subject="{!account}"
             list="Service_Credits__r"  />
        </apex:tab>             
    
    
        <apex:tab label="Assets" name="Assets"
            id="tabAssets">
            <apex:relatedList subject="{!account}"
             list="Assets"  />
        </apex:tab>  
    </apex:tabPanel>

 

 

Mark MoggyMark Moggy
Thanks Bro' good coding! How did you find out the correct list values? Because I can't find the value 'ActivityHistories" anywhere!