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
Balu Phrabha123Balu Phrabha123 

Custom setting records delete


How to delete Custom MetaData Records Via Apex class?

custom meta data = Metadata__c

Agustin BAgustin B
Hi Balu, try something like this:
List<String> recordsToDelete = new List<String>();
service.deleteMetadata('CustomMetadata', recordsToDelete);

If it solves your issue please mark this answer as correct, it may help others
Agustin BAgustin B
sorry forgot this :
MetadataService.MetadataPort service = new MetadataService.MetadataPort(); 
VinayVinay (Salesforce Developers) 
Hi Balu,

Custom MetaData Records cannot be delete via Apex.

Review below link for same.

Below is the Idea link please vote.

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Vinay Kumar
Bernard MillerBernard Miller
I think don't use post entire code.