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
Marilyne PMarilyne P 

Mapping of old and new Opp,Quote, Quote line item, durring Opportunity Clone

Hello,

How can i detect that a opportunity is cloned witht the products ? and how can i make a map between old and new, opportunity , quote and quote line item ?

thank you for suggestion !
Abhishek BansalAbhishek Bansal
Hi Marilyne,

As per  the information mentioned in the link given below, If you are cloning the opportunity with products then isClone variable will be set as true in the trigger and if the opportunity is cloned without products than this variable is set as false.
https://salesforce.stackexchange.com/questions/127792/opportunity-standard-clone-button-how-to-detect-cloned-record-in-an-apex-trigge?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
trigger OpportunityClone on Opportunity (before insert) {
for (Opportunity o : Trigger.new) {
    if (o.isClone()) {
        o.StageName = 'Identification';
        o.IsCloned__c = true;
        o.Roll_Out_Plan__c = NULL;
        o.Rollout_Duration__c = NULL;
        o.Roll_Out_Start__c = NULL;
        o.External_Opportunity_ID__c = NULL;
   }
}
}

If Opportunity is cloned with products than o.isClone() = true else false in case of without products

Regarding your second query, I am not sure what map you need to generate. Can you please provide some more details on this requirement.

Thanks,
Abhishek Bansal.