[SalesForce] ‘DML operation DELETE not allowed on AccountHistory’

I am keen to delete some rows from the AccountHistory related list. This is because I initially did tracking history of too many fields and now the AccountHistory is overly long and this increases the time load of an account page.

Running an anon script via Workbench, I hit this error:

'DML operation DELETE not allowed on AccountHistory'.

I confirmed with Premier Support that AccountHistory (and it seems other History related lists) are locked.

Is there any way to get around this, so that unrequired rows can be deleted?

Thanks

Best Answer

It is very risky, but apparently there is a known workaround: delete and recreate the affected Account.

Before you take any actions, back up all data. Make sure this includes all child data.

If you have a small number of records, you can clone them in execute anonymous (don't preserve id), delete the existing records, then insert the clones.

Related Topic