Groovy code to create an Opportunity Partner using the data of Partner record from another Opty rec
I have a requirement to create an Opportunity partner record in an Opportunity based on the Opportunity Partners already added in a different Opportunity.
When Opportunity A is linked to Opportunity B, I need to pull the Opportunity partner records from OptyB and create new partner records on Opportunity A using the data of Opportunity B.
Version (include the version you are using, if applicable):
Code Snippet (add any code snippets that support your topic, if applicable):
I have the below code to create the Partner record on Opty A.
def OptyPartner = OpportunityA.RevenuePartner (I am creating OptyPartnercollection in Opty A record using this line)