You need to sign in to do that
Don't have an account?
SunnyShiny
pageBlockTable > three tables in relation (can i access the third one ?)
<apex:page standardController="Opportunity">
<apex:pageBlock title="LineOrder">
<apex:pageBlockTable value="{! Opportunity.Order__r.LineOrder__r}" var="item">
<apex:column value="{! item.name}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
Is it possible to show LineOrders this way?
Thanks
SunnyShiny
Your requirement is not clear to me but in general you can easily do, using VF controller the following
Option 1 -- If you want to display a flattened list of a relationship A->B->C, then the controller will need to build such a list by :
create a wrapper class FlattenedItem and correspponding variable to List<FlattenedItem>
then execute the queries (below) and manipulate the results to instantiate the wrapper class, while building a list of FlattenedItem. You'll need maps to associate query 2 to query 1
select id, ..., (select id, ...from b__r) from A and
select id, ..., (select id, ... from c__r) from B
Your VF pageBlockTable will refer to the value of the list of the FlattenedItem
Option 2 - If you want to have nested pageblocktables, then your wrapper class needs to be more sophisticated as a wrapper object of A containing a list of wrapper object B where each wrapper B is a list of wrapper C
You'll still need the two SOQL queries
There are plenty of examples on nested tables and wrapper classes found by web searches
All Answers
So, NO solution ?
Or I can create the query through a controller and populate the list ?
SunnyShiny
Your requirement is not clear to me but in general you can easily do, using VF controller the following
Option 1 -- If you want to display a flattened list of a relationship A->B->C, then the controller will need to build such a list by :
create a wrapper class FlattenedItem and correspponding variable to List<FlattenedItem>
then execute the queries (below) and manipulate the results to instantiate the wrapper class, while building a list of FlattenedItem. You'll need maps to associate query 2 to query 1
select id, ..., (select id, ...from b__r) from A and
select id, ..., (select id, ... from c__r) from B
Your VF pageBlockTable will refer to the value of the list of the FlattenedItem
Option 2 - If you want to have nested pageblocktables, then your wrapper class needs to be more sophisticated as a wrapper object of A containing a list of wrapper object B where each wrapper B is a list of wrapper C
You'll still need the two SOQL queries
There are plenty of examples on nested tables and wrapper classes found by web searches