Trying to create query for Contacts Table and Team Member Table. Would like to get data from contacts of off the Opportunity record like Opportunity ID, Contact Name, Phone.

Also would like to get data of off the Opportunity record Opportunity ID, Team Member where Member Role = "Assosiate".

  • 3
    what did you try and why did that fail?
    – kurunve
    Jun 27, 2016 at 15:24

1 Answer 1


You can query the OpportunityContactRole and use relationships to get Fields from both the Contact and the Opportunity.

[SELECT Contact.Field, Opportunity.Field FROM OpportunityContactRole WHERE Role = 'Associate' AND OpportunityId = :yourOppId]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .