Questions tagged [opportunitycontactrole]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
17 views

Opportunity Contact Role - Report including record ID

My users need to create reports on Opportunities and Opportunity Contact Roles that would include the Opportunity Contact Role ID. Supposedly because this is a junction object, the record ID field can'...
  • 5
0 votes
1 answer
36 views

Reporting on Opportunity Contact Role

I need to create a report with the Last Modified By and Last Modified Date from the Opportunity Contact Role object. This is a standard junction object and the standard field Last Modified By is in ...
  • 5
0 votes
1 answer
35 views

Email To Salesforce - Activity logs to wrong Opportunities

Email to Salesforce feature allows us to capture any Email sent from external email applications and log those under Opportunities(other objects too but here we're talking only for Opportunities). In ...
-1 votes
1 answer
16 views

SOQL To Get Account fields associated with an Opportunity Contact Role to Opportunity Object

I'm looking to see if there is any way to access the Account Fields (ie: Account_Billingaddress) associated with the Opportunity Contact Role from the Opportunity Object. Opportunity->Opportunity ...
-1 votes
1 answer
351 views

lwc - How to get a list of all contacts associated with an opportunity?

I am building a Lightning Web Component (lwc) which is placed on an Opportunity record page. I can easily get basic information on the opportunity with a @wire service, such as: @wire(getRecord, { ...
0 votes
1 answer
98 views

How to display only primary contact of Opportunity

I just start to learn Salesforce and now I try to create VisualForce page that display info about primary contact. I tried to use {!Opportunity.OpportunityContactRoles.Contact.Name}, but that way I ...
  • 29
0 votes
1 answer
62 views

IF rule on a checkbox field, but the condition is on the Contact field

Here's the dilemma, I have a few contacts related to each opportunity. Each contact has their own Contact Role, let's say Sales, Tech, and Product. I have a checkbox field for Sales, Tech, and Product,...
  • 1
0 votes
1 answer
55 views

How to map account name with list of phone numbers

I am trying to map the account name with the related phone numbers set<String> phoneNumbers = new set<String>(); Map<String, set<String>> clientNamePhone = new Map<String, ...
0 votes
1 answer
87 views

update opportunity contact role

I am trying to update the opportunity contact role object. How to i find the id of the contactrole? What do i need to be updating? I have tried: $url = "/services/data/v40.0/sobjects/...
  • 127
1 vote
1 answer
113 views

Salesforce api list all possible contact roles

I have an app that my users can create their own opportunity contacts. I need to present a list of possible contact roles. What can i call to get that list? The OpportunityContactRole requires I ...
  • 127
0 votes
1 answer
85 views

I want to force users to enter a contact role prior to saving new opportunities. Can this be done?

I have a basic opportunity object and would like to require sales teams to enter at least one Contact Role in order to save the Opportunity.
0 votes
1 answer
53 views

Opportunity Trigger - Detect if Contact Role will be created?

I'm trying to automate creating Opportunity Contact Roles when an Opportunity is created, and I'm not having any difficulty creating these. What I'm struggling with is, in the case when an Opportunity ...
-1 votes
1 answer
231 views

Opportunity stages required Contact roles other than the first stage

I have a use case whenever I change the opportunity stage from Stage - 1 to any other stage Contact role should be mandatory to change the stage other wise it has to throw a error message how can I ...
  • 5
1 vote
1 answer
1k views

Contact Roles Association in Opportunity Related List on Contact Layout

I want to see the contact roles associations inside the Opportunity related list placed on Contact page Layout. But my current opportunity list is visible as below. Is there any method that I can ...
3 votes
1 answer
94 views

PushTopic for OpportunityContactRole

I'm creating PushTopics for streaming api and have trouble creating one for OpportunityContactRole object. Executing the following apex code in Developer Console Window PushTopic pushTopic = new ...
  • 131
0 votes
0 answers
113 views

Cannot Deploy Lighting Web Component with Opportunity Contact Roles

I'm trying to deploy a simple component for OpportunityContactRoles but I am not able to deploy the Meta data necessary to expose the component to the Opportunity Record Page. I've tried just exposing ...
  • 1,318
0 votes
1 answer
38 views

Add Custom VF Button to OpportunityContactRoles Related List

Evening, I'm attempting to launch a Screen Flow from a VisualForce Page on a related list for OpportunityContactRoles. The flow will be a guided process for ContactRoles. The Related List for the OCRs ...
  • 1,318
0 votes
1 answer
414 views

Make Opportunity SOQL subquery of Contacts return all opportunities in the contact's related list, not just primary ones?

I have Contacts who are associated with multiple Opportunities via multiple OpportunityContactRoles. Some of those OpportunityContactRoles have IsPrimary = true; others don't. In the Lightning UI, in ...
  • 101
11 votes
2 answers
19k views

Using a collection of IDs to Get Records using FLOW

I am trying to Get multiple contacts from Flow by using a collection of IDs. In the below image I am looping through each opportunity contact and adding the Contact Id to a collection. Then I want ...
0 votes
0 answers
150 views

Confounded by Test Class Failing in Production but Passing in all Identical Sandboxes

I finally have to ask some other folks about this one. There's a test class from an (awful) unmanaged package in our org, and it has been there for a year and never been a problem, but suddenly it is ...
  • 800
1 vote
1 answer
486 views

Return a custom List of Contacts & Opportunity Contact Roles from Account

I am attempting to query a list of Contacts (associated to the account) & OpportunityContactRoles (if applicable). So when a user is on an Opportunity Record they are able to see a full list of ...
  • 466
1 vote
1 answer
751 views

Batch class to update Contacts in Opportunities' Opportunity Contact Role

I have a requirement where I check for all Contacts related to Opportunities via Opportunity Contact Role junction object. For an Opportunity in particular stage, I update related contacts' with ...
  • 13
1 vote
2 answers
3k views

SOQL Query for Contacts (Related to the Account) & Opportunity Contact Roles - In a LWC (Lightning Web Component)

For a given opportunity I would like a list of all contacts related to that opportunities Account & all of the opportunitycontactroles. For example: if account a has three contacts and two of ...
  • 466
3 votes
1 answer
560 views

Not getting custom field on Add Contact Roles

I need one help.I have a custom field in Opportunity Contact Role. But after clicking on Add Contact Roles, we are not getting the custom field. Can you please help how can I add the field.
  • 43
2 votes
1 answer
56 views

Source of an erroneous "You have uncommitted work pending" error in Test?

From the top, I do understand how "You have uncommitted work pending" errors happen, but the following is very strange behaviour from Salesforce... It seems that for one org we have, creating an ...
  • 13k
2 votes
1 answer
124 views

OpportunityContactRole seems to have incorrect values for IsPrimary in trigger context

I've seen some strange behaviour with the new ability to have trigger on OpportunityContactRole and its rather special IsPrimary field. For a long time, I've observed that if you set IsPrimary=true ...
  • 13k
0 votes
0 answers
125 views

Populate fields from Contact onto Opportunity when a "New Opportunity" button on contact is Clicked

I created a button on Contact which is supposed to create a new opportunity, populate fields and create an Opportunity Contact Role on Opportunity when a Sales Rep clicks on New Opportunity Button. ...
1 vote
1 answer
542 views

Visualforce Pages: Pulling contact roles from opportunity into related object

I have a VF page that is supposed to pull the contact role information from the opportunity page. The code works on the opportunity page, but I need to add it to a related object (custom object). The ...
's user avatar
0 votes
2 answers
267 views

Prevent Opp Creation Without Contact

We're looking to ensure that every newly created opportunity has an OpportunityContactRole upon creation. To do this, we removed the New Opportunity button everywhere which would force reps to ...
2 votes
2 answers
834 views

Primary Contact Role is getting saved without role in Lightning

When you mark a Contact as primary while adding it as Opportunity contact role in Lightning, It allows to save even without assigning a role to the primary Contact. When we try the same thing in ...
  • 13.4k
0 votes
2 answers
605 views

Visualforce page to create a new Opp Contact Role

Is it possible to create a custom Visualforce page for adding a new Opportunity Contact Role using standard controllers (Opportunity controller in this case)? The reason I'm asking is that I'd like to ...
  • 61
1 vote
1 answer
1k views

Creating Opportunity and Opportunity Contact Role from Contact in LEX

In Salesforce Classic, you can create a new opportunity using a URL like the below: /006/e?ent=Opportunity&conid={!Contact.Id} This works great, creates the opportunity, and creates an ...
  • 113
-1 votes
1 answer
620 views

Apex Triggers Copy Primary Contact Role into lookup field in the opportunity page

I copy this formula and it works great when the lookup field is null but if I want to change the Primary contact Role the lookup field does not change (it keeps the first contact Role assigned) Can ...
0 votes
2 answers
97 views

Contact information on Opportunity record

I'm building an integration between Salesforce and a proposal creator tool. Most of my users use the integration from opportunity object. I'm using the integration to pull opportunity data in the ...
  • 973
0 votes
1 answer
695 views

Selecting opportunity contact role on related contact account

Part of our process before an opportunity is closed won, we need to create contact roles, until now if a contact is related to 2 different companies we create both accounts and we duplicate the ...
  • 1,899
0 votes
0 answers
118 views

SOQL on OpportunityContactRole in Trigger doesn't return any result in Lightning

I have a trigger on Opportunity object, which populates primary campaign source using a custom logic. As part of my logic, I am querying OpportunityContactRole in the trigger. The query gives result ...
  • 2,674
0 votes
2 answers
1k views

Require Contact Role on all newly created Opportunities

I'm trying to come up with a way to require every new Opportunity to have a Contact Role associated with it upon creation. The issue I'm running into is the stupid "Recently Viewed" Opportunity List ...
0 votes
1 answer
258 views

Lock Opportunity Contact Role record

Since the OpportunityContactRole object is not a first class object you cannot create a trigger on the object, nor add fields or create a validation rule. Is it possible to prevent the deletion of an ...
  • 2,353
3 votes
1 answer
268 views

Querying Opportunities related to a contact return only Open Opportunities

I am doing subquery Of Opportunities on Contact as follows:- Select id,(select id from Opportunities) from Contact where id in (select ContactId from OpportunityContactRole) I know this will return ...
  • 13.4k
0 votes
1 answer
303 views

Cannot loop through Opportunity Contact Roles' for loop?

I have the below implementation: Map<Id, Contact> contIdsMap = new Map<Id, Contact>(conts); Map<Id, Opportunity> relatedOppMap = new Map<Id, Opportunity>([Select Id, Name ...
0 votes
1 answer
67 views

Contacts without Opportunities

1) I need to see if a contact has an opportunity. 2) If not, I will create a new opportunity. 3) I'd like to do this with Process Builder. Part 1 is my challenge. How do I test to see if a contact ...
  • 319
1 vote
1 answer
418 views

OpportunityContactRole Query returning Empty List

I used a Query on OpportunityContactRole in Opportunity Trigger. for(OpportunityContactRole c: [SELECT Id, opportunityid, contactId FROM OpportunityContactRole where opportunityid in: newOpp]...
1 vote
1 answer
617 views

Mass email Opportunities with Email template

I have some custom fields on the Opportunity page layout; one captures the contact name and one is for the contact email. These are formula fields that query the contact roles related list. Once the ...
  • 49
1 vote
2 answers
1k views

How do you populate contact roles based on a custom lookup field in Opportunities for the Primary Contact?

Our current sales process has a lead converted to an opportunity. There is a custom lookup field on the Opportunity to identify the primary point of contact. Once that lookup field is populated, we ...
  • 49
0 votes
1 answer
34 views

Contact Roles Question

Is there any way to pull the Contact from the Contact Roles related list into a lookup field on the record? For instance, I have a customer with hundreds of opportunities all with their primary ...
  • 1
1 vote
1 answer
1k views

Updating Opportunity when Primary Opportunity Contact Role is changed

I'm running into a challenge around automatically updating Opportunities. My Opportunities' names are generated by a workflow. This workflow pulls from various fields on the Opportunity object. ...
  • 137
2 votes
1 answer
193 views

How to make OCR required when the Opportunity reaches the certain stage?

I know there are many solutions for making the Contact Role required on the Opportunity object, but I couldn't find one that could solve my problem. I need the Contact Role to be required if the ...
  • 33
1 vote
2 answers
2k views

SOQL to find contacts related to specific opportunities

I need a query that returns me all contacts that were involved in an opportunity but ignore the ones that were involved in a opportunity recently (10 last days). I tried using a subquery, like this: ...
-1 votes
1 answer
35 views

Lead Convert guarantees Contact Attribution on Opportunity. How to guarantee it when Opportunity is created from Standard Contact Detail Page?

Here are options, examples, my comments, and my requirement for different approaches to creating Opportunities from the Standard Contact Detail Page. I am looking for help with option 3. I need to "...
  • 1,080
0 votes
1 answer
261 views

Creating InvocableMethod for OpportunityContactRole

I have seen lots of people struggle to insert opportunity contact roles as they cannot be inserted using process builder (not a first class object). There are some work around using flows but these do ...