<tr>
<td><b>• </b> Main Contact "{!relatedto.acc.Contacts}".</td> <br/>
</tr>
</apex:repeat> The part in italics is what I have added to try and include the contact related list but I get the error 'Invalid field acc for SObject Opportunity'.I'm not good on code; is there a simple way to bring in a related list from a related object?Any help is much appreciated!Thanks.
4 answers
Hi Raj, sorry, I wasn't very clear. It's not the contact the email is being sent to I need to change. I need to add a list of the related contacts from the Account into the body of the email.I have also tried this: <apex:repeat var="acc" value="{!relatedTo.Account}"> <tr>
<td><b>• </b> Main contact {!relatedto.Account.Contacts}.</td> <br/>
</tr>
</apex:repeat> But get the following error message: Aggregate Relationship is used in an unsupported complex expression containing 'Account.contacts'