You need to sign in to do that
Don't have an account?
John Radcliffe
Multiple Opportunity Contact Role Cloning in a New Record Type
Hello all,
I am building a flow to clone a closed-won opportunity in a pipeline for our Support team to conduct training etc. I need to bring all Opportunity Contact Roles with the clone. I figured out how to clone a single Contact Role, but most of our Opportunities have more than one, all of which we need. I've tried two methods:
First, Fast Lookup & Fast Create with sObject Collection Variables which succeeds in duplicating multiple Contact Roles but associates them with the closed-won opportunity, not the new Support Opportunity (I have the Support OpportunityID in a variable but haven't figured out how to use the Assignment element to replace the old OpportunityID with the new OpportunityID).
Second, with Record Lookup & Record Create via a Loop. In this case, the loop succeeds in cloning the Contact Roles but only the first one - it gets hung up on the first ContactID and doesn't skip to the next one.
What am I doing wrong? Either method is a viable solution, and any help would be greatly appreciated.
John
I am building a flow to clone a closed-won opportunity in a pipeline for our Support team to conduct training etc. I need to bring all Opportunity Contact Roles with the clone. I figured out how to clone a single Contact Role, but most of our Opportunities have more than one, all of which we need. I've tried two methods:
First, Fast Lookup & Fast Create with sObject Collection Variables which succeeds in duplicating multiple Contact Roles but associates them with the closed-won opportunity, not the new Support Opportunity (I have the Support OpportunityID in a variable but haven't figured out how to use the Assignment element to replace the old OpportunityID with the new OpportunityID).
Second, with Record Lookup & Record Create via a Loop. In this case, the loop succeeds in cloning the Contact Roles but only the first one - it gets hung up on the first ContactID and doesn't skip to the next one.
What am I doing wrong? Either method is a viable solution, and any help would be greatly appreciated.
John
I believe it would help if you can post a screenshot of your flow. However, based on your explanation:
- For the first method, whenever you are doing a Fast Lookup, you need to run a loop on the collection created and replace the OpportunityId with the new OpportunityId (Support Opportunity), add them to another collection, exit the loop and then go with Fast Create.
- Second method will not work as the same is not bulkfied and would be fetching only the first Contact Role against the original opportunnity.
Hope this helps. please mark as best answer if it does.Cheers!!
Gaurav
All Answers
I believe it would help if you can post a screenshot of your flow. However, based on your explanation:
- For the first method, whenever you are doing a Fast Lookup, you need to run a loop on the collection created and replace the OpportunityId with the new OpportunityId (Support Opportunity), add them to another collection, exit the loop and then go with Fast Create.
- Second method will not work as the same is not bulkfied and would be fetching only the first Contact Role against the original opportunnity.
Hope this helps. please mark as best answer if it does.Cheers!!
Gaurav
Are you trying to update Primary Contact field on Opportunity or on the Contact Role?
Regards
Gaurav
In this case, you would need to follow the same steps as John Radcliffe did, with only one modification that instead of fetching all the Contact Roles, you need to filter the result using a filter condition of "Primary" and rest of the steps would be same.
You might not need to run a loop if you have only a single Contact Role with flag of Primary, but for future scope it is recommended that you keep the loop in place.
Hope this helps. In case of any further clarification, please feel free to contact at gaurav.handoo@gmail.com
Regards
Gaurav