Looking into the .clone() method, is it possible at all to clone the record history of a record?

Say I have an account which I wish to clone, is it possible to clone this account entirely and also all the line entries in its underlying account history?

I assume not, as when one tries to edit the activity object of a record, a 'Locked' error is thrown.

Thanks, Andy


I do not think Salesforce allows this, since the record history would not be useful as an auditable history if you could modify it.

AccountHistory only supports the following calls:

describeSObjects() getDeleted() getUpdated() query() retrieve()



| improve this answer | |

The record history is stored in a different table (AccountHistory), and is not writeable either in Apex or using the Dataloader.

You could create a new custom object to store history data and associate to the new Accounts.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.