Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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> 
</apex:page>

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"/>  
</apex:page>

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
add comment

1 Answer 1

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"/> 

</apex:page>
share|improve this answer
    
Brilliant! Works like a charm - Thanks very much. –  AngiB Feb 7 '13 at 14:05
add comment

Your Answer

 
discard

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.