Is it possible to map any custom fields at the Contact level to an Opportunity via Process Builder or WFR? Or can this only be done via a Trigger?
1Do you have a lookup to Opportunity from contact object?– sfdxFeb 25, 2016 at 22:29
You can do this with Process Builder/Flow. Please explain in more detail how the relationship works and we can help you with the solution.– David LittonFeb 25, 2016 at 23:26
For instance, is it a Contact lookup on the Opportunity that is your 'primary contact' or something else? How do we know which field needs to be put onto the Opportunity?– David LittonFeb 25, 2016 at 23:47
@DavidLitton essentially I want whatever Contact is listed as Primary on the Opportunity to feed certain fields into the Opportunity. For example, I have multiple attribution fields beyond "Lead Source" that live on the Contact that I want copied to the Opportunity. So if an Opp is created from the Contact page, and that Contact is automatically added as Primary, those fields would be mapped over. If the Opportunity is created by itself and the Primary added later, the fields would map at that time. Is that doable?– MattFeb 25, 2016 at 23:56
Ok so you're problem is that you can't have a Process Builder triggered off of Primary Contact. If you had a lookup or a button somewhere you could. So... if we did it where we looked on Opportunity create to see if one exists, that is fine. However, if you wanted to add the Primary Contact later then it wouldn't map over without some sort of user interaction. For that option you would be to create a button or checkbox that says 'populate primary contact details' and that triggers the process builder. Your other option is to do an Apex Trigger.– David LittonFeb 26, 2016 at 0:06
Why not just create formula fields on the Opportunity Contact Role object pulling the data you want from the original contact.
Then you could build a process builder that is called whenever an Opportunity Contact Role is created. You would then update the related Opportunity record with the relevant fields from the Opportunity Contact Role onto the Opportunity itself.
For anyone seeking to do the same, this is what I did... I basically used a required lookup field to act as the "primary contact" for the opportunity. Then used process builder and a flow to copy across fields from the contact and add that same contact as a contact role on the opportunity.
It's not the most elegant solution, but it works. Here's a few resources that I found that walked me through the process, which I just adapted to suit my needs: https://judisohn.com/2015/04/06/using-salesforce-process-builder-flow-with-opportunity-contact-roles/ and http://www.arkusinc.com/archive/2015/opportunity-contact-roles-with-process-builder-and-flow
Fast forward 6 years later....
I ran into this post now, and it is possible to implement a solution with the current Flow functionality:
Create a flow triggered by 'Opportunity Contact Role'
Add a Get function to get the Contact record by Contact ID
Get the relevant opportunity in the same way
Update the opportunity with the relevant fields from the contact