I have a beta-managed-package the when deployed has a Apex Metadata API call out that allows users to modify some Custom Metadata that is shipped via the the code. It also allows them to create new Custom Metadata Entries.
This works fine in scratch orgs, and our packaging org, however, we discovered when we installed the beta-package in another developer or scratch org that the Metadata was not deploying after we called:
Metadata.Operations.enqueueDeployment(container, callback);
I captured the exception in a custom field and it says:
Not allowed to install metadata via apex
.
I am only installing for Admins, whom have Modify all data
permissions, and all the fields on the Custom Metadata type are subscriber editable?
Any ideas?