+ Start a Discussion

Unable to reference a lookup relationship



I was trying the example provided in the visualforce pdf, about creating a tab view for the Account page. It worked fine when I just used the same but when trying to reference it with custom objects created it does not work.

The example provided in the pdf

<apex:page standardController="Account" showHeader="true" tabStyle="account" > <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="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:tabPanel> </apex:page>

I am trying to do the same for some custom object. I have a Customer object called Position, there are 2 objects in the related list Job Application and Employment Website.

when I try to execute my code I get message that they are not child object for the entity.

My code is


<apex:page standardController="Position__c" showHeader="true"> <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="PositionTabPanel" tabClass="activeTab" inactiveTabClass="inactiveTab"> <apex:tab label="Details" name="positionDetails" id="tabdetails"> <apex:detail relatedList="false" title="true"/> </apex:tab> <apex:tab label="Job Application" name="Job Application" id="tabjobapp"> <apex:relatedList subject="{!Position__c}" list="" /> </apex:tab> <apex:tab label="Employment Websites" name="employment websites" id="tabempweb"> <apex:relatedList subject="{!Position__c}" list="" /> </apex:tab> </apex:tabPanel> </apex:pag


Make sure you have the master-detail relationships setup correctly. Also, can you add the exact error you get ?


These objects are not a part of Master-Detail relationship. They just lookup values and are related to each other that way. Is there any way that I can show the details of a related object which is not a child? Thanks KD



I have a proper Master-detail relationship between 2 customer object, but i fail to do what was established in the example.

How do you name the related field in the "List" option?

I keep getting the following error

"list name" not a valid child relation ship name for entity




You need to add a value for the related list attribute. To specify this value, use the name of the child relationship to the related object. For example, to display the Contacts related list that would normally display on an account detail page, use list="Contacts". I can't see any name in your code.