+ Start a Discussion
StaciStaci 

custom object lookup to opportunity, get primary contact

I have a custom object that has a lookup to Opportunity.  I have an apex page that renders a pdf. 

I need to get the primary contact of the related opportunity onto the pdf.  I have found and tried this, with no avail.  It gives me an aggregate error:
 Aggregate Relationship is used in an unsupported complex expression containing 'Opportunity__r.opportunitycontactroles'
<apex:outputPanel>
             <apex:repeat value="{!Machine_Quote__c.Opportunity__r.OpportunityContactRoles}" var="opcr" >
                     <apex:outputText rendered="{!opcr.IsPrimary == True}">
                         <td><apex:outputField value="{!opcr.ContactId}"/></td>
                     </apex:outputText>
             </apex:repeat>
             </apex:outputPanel>

Please help??  TIA!