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
_dj_dj 

Cloning a salesforce account

Is there a way to clone a salesforce account so that all object types with custom field definitions are copied over? Copying of the associated data with the structure could be optional.

Hitesh
DevAngelDevAngel

Hi _dj,

I need one piece of crucial information.  Where are you cloning to? A database, another salesforce.com organization?

The former is possible the latter is not.  To clone to a db, you will use the describeSObject call which returns all of the information required to build the database tables.  Some relational information is available from the referenceto type fields, but you may need to establish some relationships manually.

Once you have your db tables built, you can construct queries with select lists based on the columns of your db tables, or based on the describeSObject fields lists.

_dj_dj
The target is another salesforce.com organization. Why? Same reason as requested by other developers, to clone objects in development environment for testing.

I heard there is a pilot program for cloning. Any pointers?

Thanks
Hitesh