ForceChallenges
ProblemsDailyNotesInterview
Sign in

Practice

All problemsSOQL practiceApex trigger challengesDaily challengeOpportunityTrigger.oldMapBefore UpdateBulkificationContactValidationGROUP BYSemi-JoinAccountBefore Insert

Interview questions

All questionsAdminAdministrationApexApex TriggerAsync ApexDevelopmentField ServiceField ServiceIntegrationLwc

By company

DeloitteSalesforceAccentureInfosysPwCCognizant

Learn

Study notes

ForceChallenges

AboutContact usPrivacy PolicyTerms of ServiceFor AI assistants (llms.txt)
© 2026 ForceChallenges · Salesforce SOQL & Apex trigger practice
Sales Cloud questions54 of 79
Sales CloudMedium 2 min read

Why are Opportunity Contact Roles essential for mapping stakeholder influence during sales cycles?

Answer

Basics: B2B deals involve many people. A contact role is a junction record linking a Contact to an Opportunity with a Role picklist value. Without it, reps tend to rely on a single champion, and losing that person kills the deal.

How it works: 1) On an Opportunity, open the Contact Roles related list and add a contact with a Role. 2) Mark exactly one as Primary (IsPrimary). 3) Lead conversion can create a contact role on the new opportunity. 4) Roles are stored in OpportunityContactRole (OpportunityId, ContactId, Role, IsPrimary). 5) Customize role values under Setup > Picklist Value Sets / Opportunity Contact Role field Role.

Advanced / deep dive: Contact roles feed Customizable Campaign Influence: a campaign member on a role contact can be credited for influence, so incomplete roles mean wrong marketing attribution. They also power Einstein Activity Capture and email association logic in some features. Accounts have a separate construct: with Contacts to Multiple Accounts enabled, AccountContactRelation carries Roles (multi-select), distinct from opportunity roles. You cannot create a roll-up summary or validation rule that counts contact roles, because the relationship is not master-detail; to enforce a minimum, use a record-triggered Flow or Apex on stage change that queries roles. For multi-threading analytics, report with the "Opportunities with Contact Roles" report type, or CRM Analytics.

Code / config example:

apex
// Find opportunities in a set with no primary contact role (bulk-safe)
Set<Id> withPrimary = new Set<Id>();
for (OpportunityContactRole r : [
        SELECT OpportunityId FROM OpportunityContactRole
        WHERE OpportunityId IN :oppIds    ]) {
    withPrimary.add(r.OpportunityId);
}
Set<Id> missing =  <Id>(oppIds);
missing.removeAll(withPrimary);
Practice SOQL & Apex
PreviousWhat is Partner Relationship Management (PRM) in Sales Cloud, and how does it empower channel partners?Next What features does Pipeline Inspection offer sales managers to review and accelerate deal closures?

More Sales Cloud questions

  • How does the account merge mechanism consolidate duplicate enterprise accounts and associated child records?
  • Why is defining structured lead status lifecycles essential for accurate sales funnel measurement?
  • What are the operational boundaries and best practices for sending mass list emails within Sales Cloud?
  • How can screen flows be utilized to build custom guided selling flows directly on opportunity pages?
  • How do approval processes automate complex discount and deal desk sign-offs in Sales Cloud?
AND
IsPrimary
=
true
new
Set

Hidden gotchas & must-remember points:

  • Only one contact can be Primary per opportunity; setting another reassigns it.
  • You cannot enforce "at least N roles" with a validation rule or roll-up.
  • Contact roles on accounts (AccountContactRole) are legacy; with Contacts to Multiple Accounts use AccountContactRelation.
  • Campaign influence attribution depends on contact roles being populated.
  • Role picklist values are shared across the org; changes affect all opportunities and reports.
  • Lead conversion only creates the role if you create the opportunity.

Best practice: Require at least a primary contact by stage through Flow, and review role coverage in pipeline reviews.

Sales CloudContact RolesStakeholder Mapping