+ Start a Discussion
Marilyne PMarilyne P 

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


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.
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.

Abhishek Bansal.