I'm trying to render an item from one related list on PDF. the structure is following:
I have Sales Order, where is lookup field to Company, on Company is related list of Bank Accounts which I need to render. The Bank Accounts are related to Company through lookup, not master-detail. Here is code which I'm using:
<apex:repeat value="{!salesInvoice.c2g__OwnerCompany__r.c2g__BankAccounts__r}" var="account">
<apex:outputText value="{!account.c2g__AccountName__c}" rendered="true" escape="false"/>
</apex:repeat>
But get an error:
Error: Aggregate Relationship is used in an unsupported complex expression containing 'c2g__OwnerCompany__r.c2g__bankaccounts__r'
Any ideas?