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
MubarakMubarak 

clone button

Hi all,

Clone is a standard button or Custom button.If it is custom button can any one provide me code behind the clone button for cloning particular records.

thanks
Ankit AroraAnkit Arora

It's a nativ button. You can also make a custom button and clone the record.

Here is the method : clone(preserveId, isDeepClone, preserveReadonlyTimestamps, preserveAutonumber)
Creates a copy of the sObject record.

And here is the detail description : http://sfdc.arrowpointe.com/2011/03/28/cloning-records-in-apex/

Ajay K DubediAjay K Dubedi
Hi Mubarak,
Clone is a standard button in salesforce which onClick copy exactly the same behaviour of Page to another.
You can make the custom clone button also, for that you may take help from the link provided:- 
 https://developer.salesforce.com/forums/?id=906F00000008yaYIAQ
MubarakMubarak
I have page where if i click clone, the records in one fields need to clone to another field.
I include clone method but its not working.

 
Santiago GalmariniSantiago Galmarini

Hi,
I have this custom clone button created by the consultant on my opp object

/apex/Clone2?id={!Opportunity.Id}&childobjecttypes=Service_Line__c&grandchildobjecttypes=Product_Line__c&
Service_Line__c_Name=Service_Name__c&Product_Line__c_Name=Product_Name__c

The problem is that it clone and save it jumping the edit mode.
any idea how to add the edit step to this?

Thanks

SG