function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nicholas MiramsNicholas Mirams 

Get all Contacts from Task and add them as Contact Roles on Opportuntiy

Hi,

Using a Flow and process Building (assuming its possible) I would like to, once a task is added on an opportuntiy, get all the contacts from that task and then add them to the corresponding opportuntiy as contact roles.  I will try this with events also later on.

How do I do this? do I start, in the flow with a fast lookup to the task object or task relation object and then do I need a Loop and then assignment?
I also want to, once the records have been fetched, either create the contact role on the opportunity with that contact(s) or if it already exists as a contact role, update it

I am struggling and have so far got it to add a single contact, but it also duplicates it if its added again to another task

Thanks
 
Gaurish Gopal GoelGaurish Gopal Goel
Hi Nicholas,

I can help you with this requirement if you decide to use Apex Trigger. Thanks.
Nicholas MiramsNicholas Mirams
Hi,
I am not a coder by any means although I can understand a little apex and am learning to use flows, any help is appreciated
Thanks
Nicholas MiramsNicholas Mirams
I have done this using a flow and process builder but it only seems to work in lightning.  In classic when I add a task against an opportunity, adding several contacts to that task it only adds the first contact to the opportunity as a contact role.
Any ideas?
User-added image