Salesforce is cloud based platform where we configure the salesforce according to our business flow, so before jumping to Opportunity contact role, let consider a scenario where your team is working on the opportunity and your team want to discuss something about opportunity with client, now there can be so many person in company, so to whom should your team talk and who take what decision on the opportunity, as there are so many people in company so whom we should talk in the company regarding the opportunity is definitely a difficult task, so the salesforce provide us way to add contact/person account with roles in the related list of opportunity, this is what we called opportunity contact roles, so if your team know who will take decision on opportunity about quality then it’s better to add that person in contact roles, same we can have so many people which whom you can talk at your client side, so it’s better to add them in contact roles.
How to define contact roles in salesforce


Limitations in contact roles
- We can’t add any custom fields in contact roles
- We can’t add any validation rules and trigger on contact roles.
Accessing Contact information from opportunity contact roles via SOQL
There could be a scenario where you probably need to access the contact information from opportunity contact roles, one thing is definitely you needed is the opportunity ID to access the opportunity contact roles, now you want to access the contact information from contact roles, this is possible to do via Apex, see the below SOQL query which you can use in your Apex code.
SELECT Id, Opportunity.Name, Contact.Email, Contact.Name, Role, isPrimary FROM OpportunityContactRole Where OpportunityId =’OpportunityID’
Speak Your Mind