I'm trying to create an unlocked package for objects, fields, layouts, tabs and couple of other metadata.

In order to make sure that there is no dependencies with other metadata out of my package, I tried to push everything to a scratch-org, I configured it good, did some adjustments manulley (eg: History tracking) and pushed the metadata, and after solving alot of problems it worked, and the metadata are now there.

Now, I'm trying to create a the package, and when I tried to create the version using the following command:

sfdx force:package:version:create --package base-objects --wait 20 -k MY_PASSWORD -f config/project-scratch-def.json

I get the same errors again, even though my scratch-org is the default (not default devhub but default scratch-org), so everything has to be tested there, right?

what I'm missing???

this is one error: Opportunity: The entity: Opportunity does not have history tracking enabled

Case-Case Layout: The ActionId specified was invalid for ActionType QuickAction.

Event-Event Layout: In field: QuickAction - no QuickAction named FeedItem.ContentNote found

PersonAccount.ER_Individual_Account_RT: Global value set 'SOMEFIELD__c' in record type 'Individual' on the entity 'Account' cannot be resolved


You need to specify all the dependencies in your metadata. Try using force:source:pull to get the metadata back from your Scratch Org. It should include all the manual changes you've made the org, thus fixing your package. Notably, in this case, your Opportunity.object-meta.xml file should be updated with the additional configuration (enabling field history tracking).

  • thanks for your reponse! I did actually add the dependencies and pull all the metadata again, but the errors are still there, even the history tracking with Account and Opportunity, I saw a known issue about that, there is letterly no solution for that yet!!! is that means, that I should remove the history tracking from the objects??? I'll post some other errors, maybe you could help. Thanks again!
    – Mo Hamada
    May 20 '20 at 6:35
  • As per this issue, (success.salesforce.com/issues_view?id=a1p3A0000018BX2QAM) known issue is fixed. If there is something not working as expected open a support ticket. May 20 '20 at 21:34
  • I saw someone else having this issue, he posted it here: success.salesforce.com/_ui/core/chatter/groups/… It doesn't look to be fixed yet! I will create a ticket though, thanks for the help!
    – Mo Hamada
    May 22 '20 at 5:08

Make sure you have the following

  • Audit history turned on in the scratch org as shown below

      "orgName": "Sample Org",
       "edition": "developer",
       "features": [
  • In your metadata definition file, you have history tracking captured for both object level and the field level


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.