Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Make your voice heard. Take the 2019 Developer Survey now

Questions tagged [opportunitycontactrole]

The tag has no usage guidance.

2
votes
1answer
42 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 ...
0
votes
2answers
46 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 ...
0
votes
1answer
30 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 ...
-1
votes
1answer
47 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
2answers
28 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 ...
0
votes
1answer
43 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 ...
0
votes
0answers
60 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 ...
0
votes
2answers
45 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
1answer
28 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 ...
3
votes
1answer
48 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 ...
0
votes
1answer
47 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
1answer
20 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 ...
0
votes
1answer
46 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]...
0
votes
1answer
31 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 ...
1
vote
2answers
277 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 ...
0
votes
0answers
83 views

Campaigns with Leads and Converted Lead Information and Contact Roles

I'm trying to run a report to see how campaigns are performing for leads that were converted to contacts and their associated opportunities. I'm seeing some situations where Opportunity is showing up ...
0
votes
1answer
19 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 ...
0
votes
0answers
20 views

Email to Salesforce - Link To Opportunity NOT through Contact Roles

My org has SF Opportunities setup such that the one Contact for an Opportunity is a field on Opportunity itself. There is always exactly one Contact, so it makes more sense to have done it this way as ...
0
votes
1answer
175 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. ...
1
vote
1answer
62 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 ...
1
vote
2answers
522 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
1answer
29 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 "...
0
votes
1answer
79 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 ...
0
votes
1answer
296 views

configure influential campaigns to be automatically added to opportunities

The issue that we would like to retroactively associate previously-closed opportunities that are already existing in the system with campaigns. We would like this process to run through the ...
0
votes
1answer
249 views

Cannot Create Entity Subscription to Portal User

I am trying to create entity subscription for a Portal User(Isportalenabled = true) to an opportunity, but I'm ending up with the following error on insert of entity subscription. 11:40:06:128 ...
1
vote
1answer
122 views

How to display result of Custom Object in related list in SFO Side Panel?

In SFO Side Panel when you select any email whose email address is same as contact email address in salesforce,it automatically search the contact and it also display Activity History and Opportunty ...
1
vote
1answer
64 views

System.QueryException: List has no rows - How can I tie Events created for qualified Contacts to Opps created from the Contact?

Our org was configured such that Opps can only be created during Lead Conversion or from a Contact related list. This ensures each Opp has a Contact Role associated. SDRs create an Event when they ...
0
votes
0answers
43 views

Opportunity Trigger - Populate 2 Fields on custom object Every time Opportunity.LastModifiedDate Updates

2 Objects: OpportunityContactRole (OCR), Close_Plan_Contact_Role__c (CPCR) Fields: OCR - OpportunityId & ContactId; CPCR - Contact__c and Opportunity__c Description: Every time LastModifiedDate ...
1
vote
0answers
193 views

SOQL / Apex To Find Duplicates On A Junction Object ( OpportunityContactRole )

I have a rogue trigger that inserts duplicate OpportunityContactRoles when it shouldn't. I can't find the error in my code, but it's not a high-volume problem. It is, however, a daily low-volume ...
3
votes
1answer
59 views

Is it possible to pull all opportunities related to single contact via contact roles in a Visualforce email template?

We are trying to compile a broker report detailing commissions on a per broker basis (one email per broker). A single broker may be linked to multiple opportunities via the opportunity's contact roles ...
0
votes
2answers
48 views

Buyers and Sellers are in my Accounts object, entered by choosing a B or S record type. How do I manage the situation when later, a B becomes a S?

Buyers and Sellers are in my Accounts object, entered by choosing the B or S record type, ea. w its own page layout with its own fields relevant to customized to a Buyer or Seller. How can I manage ...
0
votes
1answer
227 views

Contact Role Addition Upon Opportunity Creation from Contact

I have a custom "New" Opportunity button in the Opportunity related list on Contacts. When this button is used, the Contact is not being added as a Contact Role to the resulting Opportunity? Two ...
0
votes
0answers
39 views

No OCRs created from lead conversion in unit tests

I need to write code that ensures only one opportunity is marked as active (using a custom field called Active__c) for a given contact. The code needs to run in an after update lead trigger after ...
0
votes
2answers
223 views

Remove “New” button when adding opportunity contact roles

When adding a new contact role to an opportunity, there's a "New" button available in the contact lookup menu. Problem is, if you create a new contact this way, it's not associated with any account ...
1
vote
0answers
114 views

Is there a way to give soft credit to all Affiliated Contacts (NPSP)?

My organizations receives donations from both individuals and foundations. When a foundation donates, I want to give soft credit to everyone associated with the foundation (founders, employees, board ...
0
votes
2answers
894 views

Creating a test class for an opportunity contact role trigger to get to 75%+

I am writing a test class for a trigger that creates Opportunity Contact Roles based on the primary record. I currently have 60% code coverage and am stuck determining what steps I would need to add ...
1
vote
1answer
49 views

We have an Opp with two Primary Contacts - out of curiosity how is that possible?

So though the GUI it would appear you can only have one primary contact on an opp. However we have just found an Opp with two primary contacts. Which is breaking a script we have. I cant think how ...
0
votes
1answer
1k views

Apex Trigger on Opportunity Contact Role to assign primary to first contact on list

I designed a trigger to automatically Create Opportunity Contact Roles. Our organization is using an app called FastForms which creates an account, contact and opportunity. An issue we have with our ...
1
vote
2answers
4k views

Illegal assignment from list to list (OpportunityContactRole to String)

I'm receiving the following error: Illegal assignment from List<OpportunityContactRole> to List<String> When I try to query from OpportunityContactRole and store it into a new list. I'...
0
votes
1answer
572 views

Can you query new opportunity contact roles?

Is it possible to use SOQL to list new opportunity contact roles added after a certain date? Ideally I'd like to schedule some apex that runs nightly, queries all new OCRs since the last run, then ...
3
votes
1answer
485 views

Trigger Process Builder when Contact added to Opportunity

Is it possible to kickoff a Process Builder flow when a Contact is added as a Contact Role to an Opportunity? I don't see Opportunity Contact Role as an object that can be used to start the PB, so I'm ...
1
vote
1answer
154 views

OpportunityContactRole Primary field update

I have to update Opportunity custom field when OpportunityContactRole Primary checkbox is update.My understanding is there is no trigger for OpportunityContactRole as we need to vote it here .I read ...
1
vote
2answers
132 views

is a SOQL subquery with a junction object possible? [closed]

I am trying to access Contact information from a Opportunity object across a OpportunityContactRole. Does SOQL support this?
2
votes
2answers
570 views

How to avoid creation of duplicate Opportunity Contact Role for every newly created Opportunity?

I have written a after insert trigger on Opportunity to create a Opportunity Contact Role. Here is the part of code if( trigger.isAfter && trigger.isinsert){ Set<Id> accIds = new Set&...
0
votes
1answer
51 views

Create a task on related object in trigger

I wanna create a trigger on Task created on a Contact that automatically creates a new task and assign it to related opportunity. How can I query the contact for the related opportunity? Trigger ...
0
votes
1answer
91 views

Change Contact Roles Dialog?

The dialog for the selection of contact roles differs in account & case from contact roles dialog of opportunities. In account & case objects I can only select one contact and have to click "...
3
votes
1answer
2k views

Apex Trigger to create Opportunity Contact Role based on Contact Lookup field

I have created the following Apex trigger that will create, update and delete Opportunity Contact Roles based on a Contact Lookup field placed on the Opportunity. Everything works great currently. I ...
0
votes
2answers
166 views

Set name of related list on contact

I have Opportunities that link directly to a contact with a custom master detail field, and that link to a contact via a Contact Role. One Opportunity record type (general) will use the custom Master-...
0
votes
0answers
41 views

Trigger for Opportunity ContactRole to notify Contact Owner of a new Opportunity

I am wondering if there is a way to create an Apex Trigger to notify a contact owner, when an opportunity is created with a primary contact populated in the contact role. We have a template available ...
2
votes
0answers
86 views

OpportunityContactRole security

In a nutshell, how from the REST API (outside the Apex wall here), can I tell I can create/edit/remove an OpportunityContactRole from scratch. Part I of the answer is I believe the ...