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
thecrmninjathecrmninja 

Is it possible to perform a Clone via API

I am researching for a development effort at my company.  I am hearing from some developers that it is not possible to perform a 'clone' via API.  I know that it's possible within APEX, so it seems counterintuitive that this is not possible with API's. 

Does anybody have experience with this and, if so, what approaches are available?

Best Answer chosen by Admin (Salesforce Developers) 
gm_sfdc_powerdegm_sfdc_powerde

There is no clone DML operation in Apex either.  However, you can clone the sobject in Apex and then insert the cloned object.  You should be able to do this in your API client as well.  The only difference is that, unlike Apex, you will have to explicitly remove the id parameter before inserting the cloned object.

All Answers

gm_sfdc_powerdegm_sfdc_powerde

There is no clone DML operation in Apex either.  However, you can clone the sobject in Apex and then insert the cloned object.  You should be able to do this in your API client as well.  The only difference is that, unlike Apex, you will have to explicitly remove the id parameter before inserting the cloned object.

This was selected as the best answer
thecrmninjathecrmninja

Yes, I should have noted that I was aware of an sobject based approach.  This is great information.  Thank you for explaining it so concisely and for taking time out of your day to do so.  Your expertise is appreciated.