You need to sign in to do that
Don't have an account?
Mathew Andresen 5
apex repeat through list of contacts connected to an opportunity
Hi,
I'm trying to use apex:repeat to loop through the list of contacts attached to a opportunity (through the account), but I'm getting an error. I assume my dot notation is messed up.
What I have is
Thanks,
I'm trying to use apex:repeat to loop through the list of contacts attached to a opportunity (through the account), but I'm getting an error. I assume my dot notation is messed up.
What I have is
<apex:repeat value="{!Opportunity.account.contacts}" var="con">
Thanks,
Can you please share the error that you are receiving. Also can you please specify if you are using standard controller or extension. if its an extension can you please share the code as well.
Your Page:
<apex:page standardController="Opportunity">
<apex:outputText value="{!Opportunity.Account}" rendered="false" />
<apex:iframe src="/apex/DesiredPage?id={!Opportunity.AccountId}" />
</apex:page>
Desired Page:
<apex:page standardController="Account" showheader="false" sidebar="false">
<apex:dataTable value="{!Account.Contacts}" var="con">
<apex:column headerValue="Name" value="{!con.Name}"/>
</apex:dataTable>
</apex:page>
Error is "Error: Aggregate Relationship is used in an unsupported complex expression containing 'Account.contacts'"
more complete code is