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
ExpoExpo 

Related List error in Visual Force page

I created two custom objects Interests and Favorites. Both the objects are Child to 'Account' . I get the below error when referencing the Favorites Tab in a custom force page. Below is the code, please note that I do not have any issues with the Interests objects.

 

 Error message = 'Favorites__r' is not a valid child relationship name for entity Client'

 

<apex:page standardController="Account" showHeader="False" sidebar="False"
 >
   <style>
      .activeTab {background-color: #236FBD; color:white;
         background-image:none}
      .inactiveTab { background-color: lightgrey; 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="Interests" name="Interests" id="tabInterests">
            <apex:relatedList subject="{!account}"    list="Interests__r" />     

            </apex:tab>    

            <apex:tab label="Favorites" name="Favorites" id="tabFavorites">
            <apex:relatedList subject="{!account}"    list="Favorites__r" />
            </apex:tab>  
                             
               

Best Answer chosen by Admin (Salesforce Developers) 
JimRaeJimRae

I would verify the name of the relationship on the child object.  I have run into this, especially if I renamed the custom object some time during the development process.

You can look at the field on the custom object that is the master detail relationship to the parent object.

All Answers

JimRaeJimRae

I would verify the name of the relationship on the child object.  I have run into this, especially if I renamed the custom object some time during the development process.

You can look at the field on the custom object that is the master detail relationship to the parent object.

This was selected as the best answer
ExpoExpo

Jim Rae,

 

You hit the nail on the head, I did rename the custom object some time during the development process and the Child Relationship Name was updated to Favorites1.

 

Thanks for your assistance.

 

Rgds

Sam

Shabs786521Shabs786521

Hi Jim,

 

Is there a way i can have enhanced list view (the one thats available with Standard salesforce) on a visual force listing page.

 

Can you please provide me any reference material or guide on that.

 

I will highly appritiate your help in this regard.

 

Thanks

 

Shabs

JimRaeJimRae

There is an enhancedlist tag available in visualforce.  Look in the component reference for that.

 

http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_enhancedList.htm