• Mitchell Larsen
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi!

 

I want to get the name, email address and phone number of the person marked as primary contact on the Contact Roles related list in the opportunity into my Visualforce email template.

 

I have created this code:

<apex:repeat value="{!RelatedTo.OpportunityContactRoles}" var="ContactRole">
{!ContactRole.Contact.Name}, {!ContactRole.Contact.Title}, {!ContactRole.Contact.Email}, {!ContactRole.Contact.Phone},
</apex:repeat>

 

but it lists ALL people in the Contact roles related list, and I just want the primary contact. How can I accomplish this?