Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to develop a small VF page that will eventually be added to the standard SF page for a custom object called Test_Site__c.

Test_Site__c contains a lookup relationship to an object called ELTON__Other__c.

I wrote the following VF page and it works fine.

<apex:page standardcontroller="Test_Site__c">
  <p>Site {! Test_Site__c.Description__c }.</p> 
  <p>Other {! Test_Site__c.ELTON_Other__r.Name }.</p> 

That displays a certain Test Site with it's associated ELTON Other name. That makes me think that I have the 2 objects correctly related.

And if I take Test_Site__c out of the equation I can write the page that I want for the lookup ELTON__Other__c object...

<apex:page standardcontroller="ELTON__Other__c"> 
  <p>Other {! ELTON__Other__c.Name }.</p> 
  <apex:relatedList list="ELTON__Equipment__r"/>
  <apex:relatedList list="ELTON__Equipment_Assignments__r"/>
  <apex:relatedList list="ELTON__Equipment1__r"/> 
  <apex:relatedList list="ELTON__Equipment_Loans__r"/>  

That too works wonderfully in that it displays 4 related lists for an ELTON__Other__c object

Since a Test_Site__c record only ever has either 0 or 1 ELTON__Other__c records related to it I would like to display the 4 related lists from ELTON_Other__c and display them on the related Test_Site__c page (so meaning add the lists to the tiny first page example above).

Is this even possible?

Thanks in advance for any insight you could provide :-)

share|improve this question
up vote 3 down vote accepted

Yes, it is possible. For that just use a subject parameter of the apex:relatedList tag:

<apex:page standardcontroller="Test_Site__c">

    <p>Site {!Test_Site__c.Description__c }.</p> 
    <p>Other {!Test_Site__c.ELTON_Other__r.Name }.</p> 

    <apex:relatedList subject="{!Test_Site__c.ELTON_Other__c}" list="ELTON__Equipment1__r"/> 

share|improve this answer
Brilliant! Works like a charm - Thanks very much. – AngiB Feb 7 '13 at 14:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.