Opportunity Contact Role

Last Updated on November 12, 2017 by Rakesh Gupta

opportunity Contact Role
Opportunity Contact Role

Opportunity Contact Role represents the role of Contact/Person account on an Opportunity. There is many-to-many relationship between Opportunity and Contact, through a junction object called OpportunityContactRole. In an opportunity, you may add many opportunity contact roles. There is no restriction on Account from which the Contact can come, you can add any Contact from any Account. For example, Rakesh Gupta might be the Executive sponsor for the opportunity “Universal Container”, and Edna Frank  might be the Quality Control for same Opportunity.

How to define Contact Role?

According to your business requirement, you can modify contact role for Opportunity.

To define contact role for Opportunity follow the steps Name > Setup > App Setup > Customize > Opportunities > Contact Role

Add New Contact Role
Add New Contact Role

If you want to add new role click on “New” Button, for reorder or make some value default click on “Reorder” button and save it.

Contact Role fields?
Below is the list of contact role standard fields, which Salesforce does not allow us to add any new custom field on Opportunity Contact Role.

Contact Role Standard Fields
Contact Role Standard Fields

How to add contacts as a Contact Role inside Any Opportunity?
First, choose the Opportunity in which you want to add Contact Role, then go to “Contact Role” related list click on “New” button.

Add Contact Role
Add Contact Role in Opportunity

Select Contact and its Role for particular Opportunity. You can make any contact as primary.

Contact Role
Contact Role

And Click on Save. You can add the same contact as many times in Contact role for same opportunity.

Scenario: – Few days back I got one requirement where a user wanted to update Name of all Tasks with “Primary Contact role “related to an opportunity when contact role is updated as primary.

Note: – There is certain restriction on this object unlike other system objects

  • We can’t add any custom fields into OpportunityContactRole Object.
  • We can’t add any validation rules on OpportunityContactRole object.
  • We can’t create any trigger on this OpportunityContactRole Object.

To implement above scenario we have to use Apex Schedule class and Inline VF page concept. I will explain these concepts on my next blog.

Related Ideas:- Make Opportunity Contact Roles RecordType Specific

13 thoughts on “Opportunity Contact Role

  1. I like the valuable information you supply for Salesforce through your articles.
    I will bookmark your weblog and take a look at again right here regularly.

    Good luck for the next!

      1. I need to dynamically Add Contact with a button if not present in LOOKUP at the the time of adding records. That means on the edit page.
        What I thinking is to have custom object related list which will be exact replica of Contact Role and saving it in a standard OpportunityContactRole, so that it won’t impact a general behaviour.
        Please let me know if you have some code for this.

  2. I have a trigger on the opportunity that counts the number of contact roles. When a new contact role is added, the trigger doesn’t fire until the associated opportunity is edited. Anyway to automatically fire the opportunity trigger when a new contact role is added?

  3. I can accept that they don’t want us messing with the Contact Role object. But I want to write a validation rule on the Opportunity object if the number of Contact Roles is zero. Is there a way to access that number?

  4. Rakesh, nice blog.
    Reading the user requirement “user wanted to update Name of all Tasks with “Primary Contact role“ related to an opportunity when contact role is updated as primary”, assume this include to create new Task related to Opportunity and Contact and assign to Opportunity owner?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.