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
AbAb 

duplicating object in Salesforce

Hello,

Is there any way to duplicate a object or a more simpler way to create object rather than the tradional way.
(My object has 300 fields)

Thanks
Best Answer chosen by Ab
Peter Friberg 26Peter Friberg 26
Try to use Force.com migration toolkit.
Download custom object definition.
Copy the file and rename it.
Rename the object in the new xml-file and upload it.
Never tried it though...

All Answers

Peter Friberg 26Peter Friberg 26
I don't know what you'e after but in UI there is a standard [Clone] button.
In Apex you can use the sObject clone() method: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_sobject.htm#apex_System_SObject_clone
AbAb
i want to duplicate a object like duplicating a object account. not its record
Peter Friberg 26Peter Friberg 26
Are you trying to duplicate metadata? Copy object definition 1 --> object definition 2 ?
AbAb
Yes
Peter Friberg 26Peter Friberg 26
Try to use Force.com migration toolkit.
Download custom object definition.
Copy the file and rename it.
Rename the object in the new xml-file and upload it.
Never tried it though...
This was selected as the best answer