You need to sign in to do that
Don't have an account?
santhosh
How to list Contact Name using relationships from OpportunityContactRole object?
We would like to develop a ajax custom s-control to list contact roles, and respective activities in a different way than currently being listed in default related lists in Opportunity screen. Though we were able to access the OpportunityContactRole object, we are not able to query Contact Name, Opportunity Name, and Role using relationship.
Can we achieve the above through a single query or we need to do multiple queries? In case we have to multiple queries, what is the effecient way to do it?
Select ContactId, Contact.FirstName, Contact.LastName, OpportunityId, Opportunity.Name, Role from OpportunityContactRole
From above query if try to display ContactId, I get the result shown on the page. Following is the code, which gives me the proper result.
But if I try to display the FirstName, the get 'undefined' as result. I just changed 'contact.ContactId' to 'contact.FirstName'.
So to get FirstName you have to do:
contact.Contact.FirstName
I think you can call the top level object "opportunityContactRole" instead of "contact".