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
Akanksha  PatelAkanksha Patel 

Display 3 level deep relationship data on VF Page

There is a Junction object Posting__c with two Masters Position__c and Employment_Website__c. There i a look up relationship of Position__c with Contact.(field ContactA__c)
I need to create a VF Page to display Employment_Website__c field URL__c on Contact Page.

I am able to get Employment Website field on Posting.
Code is
<apex:page StandardController="Position__c">
  <apex:sectionHeader title="Positions: {!Position__c.Name}"/>
  <apex:pageBlock title="Employment Website">
      <apex:pageBlockTable value="{!Position__c.Job_Posting__r}" var="post">
          <apex:column value="{!post.Employment_Website__r.Name}"/>
          <apex:column value="{!post.Employment_Website__r.URL__c}"/>
      </apex:pageBlockTable>
  </apex:pageBlock>
</apex:page>

The above code works fine on Position Page displaying Employment Website details. But I need to use this  VF Page on Contact Page Layout displaying all related Employment Websites.

Thanks friends in advance !
Best Answer chosen by Akanksha Patel
Akanksha  PatelAkanksha Patel
I got it long back.

All Answers

ManojjenaManojjena
Hi Anjelina,

As per my understanding Contact is the parent of Position . Posting is the junction object between position and Employee website ,So here __r will not work .It is only possible to map fields from child to parent .
Here you need to create a custom controller or Controller extention then inside that you need to create a wrapper class to map all fields as per your requirment .Then create a list of that wparrer class ,that list you need to defind as a getter/setter and use in VF page it will solve your problem .
Please check and let me know any issue .
Akanksha  PatelAkanksha Patel
I got it long back.
This was selected as the best answer