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
dave6dave6 

How to clone object/record?

I read here http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_sobject.htm that sObject has a clone method which is what I need.

 

However I'm usign the enterprise WSDL API for Java and there is no clone method on my generated objects including the base SObject.  What am I missing?  Perhaps that above link doesn't apply to enterprise WSDL API?  

 

How can do do a shallow clone (not keeping ID)?

 

Thanks,

-Dave

Jia HuJia Hu
clone() method is only supported in the Apex, not in the Soap API.

But you can clone your record in your code.