9
votes
Accepted
How to delete Custom MetaData Records Via Apex?
Yes, It is possible to delete metadata records using MetadataService.deleteMetadata method.
Here is a sample method call that should work:
List<String> recordsToDelete = new List<String>();...
8
votes
Accepted
Impossible to test Metadata.Operations.enqueueDeployment method
You might use Test.isRunningTest(). It is considered to be a bad practice to use it but for covering this case this is the only option for now.
Hopefully in the future Salesforce will add some Deploy ...
6
votes
How to delete Custom MetaData Records Via Apex?
Right now, I don't think it is possible to delete metadata records via Apex - only create/update
From the Trailhead Docs
Although there’s a lot you can do with Apex Metadata API, there are some > ...
4
votes
Accepted
How to Make Metadata.Operation deploy work?
Looks like we can't have DeployCallback defined in Anonymous Execution Window code.
If we define DeployCallback as separate class or an inner class of some class saved in the organization (not ...
3
votes
Accepted
Packaged CMDT record fails to update even for Sysadmin
Heaven (or Google) finally send me this article about Apex Metadata Deployments which states that:
When you develop a managed package, only certified packages are
allowed to use this feature of ...
2
votes
Error updating metadata via Apex
This is a known issue with 6 reports, currently tagged as Solution in Progress
2
votes
Error updating metadata via Apex
I am running into a nearly identical issue in my org that started just days ago.
cropredy posted a link to A Possible Clue
After looking at this post and the comments, there was some additional ...
2
votes
Error updating metadata via Apex
From the Metadata API doc
Users must have the Customize Application permission to create, update, and delete metadata records. Thereafter, users with the Modify Metadata Through Metadata API ...
1
vote
Packaged CMDT record fails to update even for Sysadmin
The official docs that describe why you need the setting is shared here
From the docs
Be aware of security considerations when accessing metadata using Apex.
Generally, Apex classes installed in the ...
1
vote
Update Custom Metadata Type Record
We have installer code that does this sort of thing. The only difference I can see between what we do and what you have is that in order to update a custom metadata record we first retrieve it using (...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
metadata.operations × 9custom-metadata × 6
apex × 5
metadata-api × 5
metadata × 3
deployment × 2
lightning × 1
managed-package × 1
page-layout × 1
custom × 1
isv × 1
code × 1
platform-bug × 1