We are building a managed package which having an integration with external system. We are getting the external system credentials from the Subscriber org admin and storing it in a protected custom metadata. In one of our use case we would like to Delete this Custom MetaData record through our managed package apex controllers using the following code,
List<String> recordsToDelete = new List<String>();
recordsToDelete.add('SSCC__My_Custom_Type.record1');
service.deleteMetadata('CustomMetadata', recordsToDelete);
List<String> recordsToDelete = new List<String>();
recordsToDelete.add('SSCC__My_Custom_Type__mdt.record1');
service.deleteMetadata('CustomMetadata', recordsToDelete);
Both were working fine in package org. But throwing the below exception in package installed org,
It throws error, Status code - "INVALID_CROSS_REFERENCE_KEY" Error message - "In field: members - no CustomMetadata named My_Custom_Type.record1 found"
Am I missing anything here?