Skip to main content

Questions tagged [metadata.operations]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4 votes
4 answers
15k views

How to delete Custom MetaData Records Via Apex?

I am using MetaDataService to create and update Custom Metadata. I want to also delete records created inside Custom Metadata Type. I know there is method available to delete metadata like I am ...
0 votes
0 answers
111 views

Not allowed to install or modify metadata via Apex

I know that this error is a hot topic and case for Salesforce but I tried to bypass this using some code workaround. Here is the code that I tried: // Upsert method call try { ...
0 votes
4 answers
2k views

Error updating metadata via Apex

I have an issue, I created a CMT to store a token for a integration with thirdparty system, with the SA user works fine, but it doesn't work for other users, when I check the debug logs I saw this ...
4 votes
2 answers
228 views

Packaged CMDT record fails to update even for Sysadmin

Note: There is a related Salesforce Support Case #45059901 Convinced by the answers of some real ISV experts, I refactored my Managed Release Package from ugly Custom Settings to Custom Metadata with ...
4 votes
1 answer
3k views

Impossible to test Metadata.Operations.enqueueDeployment method

We are following Deploy Metadata example from the documentation // Setup custom metadata to be created in the subscriber org. Metadata.CustomMetadata customMetadata = new Metadata.CustomMetadata(); ...
0 votes
1 answer
2k views

Update Custom Metadata Type Record

I have a controller that updates/creates metadata type records. It works fine for the creation of new records, but when I try to update existing records, I get this error duplicate value found: ...
1 vote
1 answer
307 views

What are the options of using apex to delete protected custom metadata record from subscriber org?

I know that I can use Metadata API and can use Apex to run Metadata API to delete metadata, like Custom Metadata records. I know that I can leverage Metadata.Operations class to create or update ...
1 vote
0 answers
126 views

Possible bug in Salesforce using Metadata.Operations.retrieve for packaged sObjects? [closed]

So, currently having an issue using Metadata.Operations.retrieve(Metadata.MetadataType.Layout, _layouts_); in a managed codebase. The object in question is managed and the layouts portion is trying ...
3 votes
1 answer
4k views

How to Make Metadata.Operation deploy work?

Did anyone tried to new Salesforce Summer 17 feature to deploy metadata records and layouts by Apex Code? I tried to use this feature to update custom metadata record and it fails for me. I just ...