I'm trying to delete List Views using the Apex Wrapper Salesforce Metadata API and I'm getting the following error.
Error occured processing component CustomObject__c.MyListView. In field: members - no ListView named CustomObject__c.MyListView found (INVALID_CROSS_REFERENCE_KEY).
I'm trying to do that through a partner organization. I'm following the guidelines, and I think there is a permission needed to be granted that I didn't catch yet, because from my developer organization the same code works perfect.
There is my code:
MetadataService.MetadataPort service = MetaDataJob.createService();
List<MetadataService.DeleteResult> results =
service.deleteMetadata(
'ListView', new String[] { 'CustomObject__c.MyListView' });
MetaDataJob.handleDeleteResults(results[0]);