0

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".

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

1 Answer 1

3

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]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.