I have a visualforce page with the standardController to a custom object. I want to get all orders (Orders__c) from an event (Event__c). I started by the offer (Offer__c)
Offer is in master-detail with the event and the event is in master-detail with the orders.
I have tried two following codes:
<apex:page standardController="Caterer_Offer__c" sidebar="false" showHeader="false" >
<apex:repeat var="events" value="{!Caterer_Offer__c.Event__r}">
{!events.Name}
<apex:repeat var="orders" value="{!events.Orders__r}">
<!-- {!orders.Name}-->
</apex:repeat>
</apex:repeat>
At this the error-message in the developer console is:
"Aggregate Relationship is used in an unsupported complex expression containing 'Event__r.orders__r'"
And...then I have trief to save the event and use a new variable to "repeat" all orders. I get no error message, but a error in Salesforce
<apex:page standardController="Caterer_Offer__c" sidebar="false" showHeader="false" >
<apex:repeat var="events" value="{!Caterer_Offer__c.Event__r}">
{!events.Name}
<apex:variable var="e" value="{!events}"/>
<apex:repeat var="orders" value="{!e.Orders__r}">
<!-- {!orders.Name}-->
</apex:repeat>
</apex:repeat>
Error-message: SObject row was retrieved via SOQL without querying the requested field: Event__c.Orders__r
I cannot explain it and work on it since a few hours....