function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Aaron Bailey 5Aaron Bailey 5 

Why isn't my customMetadata type or record being installed with my Unlocked 2GP?

Background and Problem
I have an unlocked second-generation managed package containing some commonly-used apex across multiple orgs. I've added a new feature requiring configuration of one of the utils. I used Custom Metadata to accomplish this configuration (just two simple picklists). The Custom Metadata type (object with fields) and record (customMetadata) are both present in the VSCode project metadata. I've created a new package version (several...actually), but when I install it, the resulting package components do not contain the type.

More Details
  • This package is not intended to ever hit the App Exchange

Questions
  1. I'm aware of the existance of postInstallationScripts, but I'm not finding good documentation on how to make that happen, IF that is even what I need. Suggestions?
  2. If I'm on the right track with my build, what am I missing to make it work?
  3. Is there a better/preferred option for allowing admin configuration of a custom feature?
VinayVinay (Salesforce Developers) 
Hi Aaron,

You can reach out to Unlocked Packages on 
https://trailhead.salesforce.com/trailblazer-community/groups/0F93A000000Lg5USAS?tab=discussion&sort=LAST_MODIFIED_DATE_DESC for inputs on your ask.

Please close the thread by selected as Best Answer so that we can keep our community clean.

Thanks,