I have a project with existing metadata that requires Account History Tracking to be enabled. I can’t figure out how to spin up a scratch org with this enabled (or to have it automatically turned on when I force:source:push the metadata into org).
The Account.object-meta.xml file does contain
<enableHistory>true</enableHistory>but that alone isn’t preventing errors like:
The entity: Account does not have history tracking enabled (348:13)
I don’t see any scratch org preferences that would seem to control history tracking for anything except contract (IsContractHistoryEnabled). I tried IsAccountHistoryEnabled, just in case, but it complains because that’s not a valid flag.
Salesforce says that they’ve logged an issue in their system but do not have a fixed timeline as to when it’d be fixed, in the Success Community discussion pointed out by Fabien here: https://success.salesforce.com/0D53A00003BauKc
The current workaround suggested by them plus common sense says:
a) Strip down Enable History Tags from Scratch org metadata and add them when deploying to sandboxes.
b) Enable History tracking manually before pushing the code to the scratch org.