[SalesForce] Where is the Custom Object Field History object

I'm looking for the object that holds field history changes for a custom object.

Related, I see that there is a ContactHistory object, but attempts to insert are rejected with

Field is not writable: ContactHistory.ContactId

I'd like to be able to insert history on a custom object, although this seems impossible.

This is a data migration issue, where changes to fields in one system need to be replicated for auditing purposes in the new Salesforce implementation.

I can understand that there are good reasons for disabling 'insert' permissions on history tracker objects, but it would be good if there was some way to temporarily enable it, in much the same way that I can request the temporary ability to change audit fields.

Best Answer

When you enable field history tracking for an object then the changes are stored in a special history table for that particular object.

The naming convention for these objects is:

[standardObjectName]History e.g. AccountHistory, ContactHistory etc.

[customObjectName]__History e.g. Car__History, Brand__History etc.

The objects are not writable and therefore you won't be able to upsert them via apex. Check these fields out using workbench.

enter image description here

Related Topic