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
Lisa SeilerLisa Seiler 

Apex:repeat two time

Hi @ all,
 I have a visualforce page with the standardController to a custom object.
I want to get all orders (Orders__c) from a 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>
</apex:page>
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>
</apex:page>
Error-message:
SObject row was retrieved via SOQL without querying the requested field: Event__c.Orders__r
Is someone able to help me?
I cannot explain it and work on it since a few hours....

Thank you and best,
Lisa