I currently have 100+ records I need to delete under my custom metadata type, and I am not keen on having to do it one by one (I will need to reset the records every now and then as our requirements keep updating). I tried to do this via Apex but according to the documentation:

Apex code can create, read, and update (but not delete) custom metadata records...

  • have you tried data loader to delete? – sfdcFanBoy Nov 29 '17 at 4:28
  • @sfdcFanBoy No, but my research tells me that it doesn't support custom metadata types. I've used the Custom Metadata Loader tool (github.com/forcedotcom/CustomMetadataLoader) but it doesn't have a delete function. – unhinged Nov 29 '17 at 5:42

As Custom Metadata Records are metadata you can use Force.com Migration Tool and deploy the destructive changes

content of destructiveChanges.xml

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.