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
Samuel JohnsonCBESamuel JohnsonCBE 

Cloning Opportunities

Requirment is to clone the opportunity with all of the related record information,  contact roles, activity history, ect..  Is this possible and if so how.  This will also need to be used in Lightning
Charan Thumma 15Charan Thumma 15
Hi Sam,

Clone ; generally clone the list of object and keep the reference.
Supports primitive data type
Parameters are not applicable.
Ex:  opli2=opli.Clone()

Deep clone : generally it clone the list of object but don't hold any reference.
doesn't support primitive datatype.
Parameter are applicable.
Ex:  opli2=opli.deepClone()

Depclone creates a new record with new ID where as clone uses the same ID for the new record.
I am guessing may be deepclone would be helpful for your requirement. 

Please mark it as best answers if it helps.