I am trying to get a list of all metadata objects with the given name. However, the code below fails:
connection.readMetadata("ApexClass", new String[] {"SampleDeployClass"});
with this error:
Exception in thread "main" com.sforce.ws.SoapFaultException: INVALID_TYPE: This type of metadata is not available for this organization
Using connection.listMetadata()
I am able to confirm that SampleDeployClass
exists. I'm using a DE org, and the user has the Modify all data permission.
Is this something expexted (couldn't find it in the docs)? If yes, how am I able to confirm that a set of metadata objects already exists (other than retrieve())?
UPDATE 1:
Seems like renameMetadata() doesn't work with ApexClasses either. Is it maybe a restriction in the API which prevents anyone from changing Apex code?
UPDATE 2:
Nor does it work using JSForce, so it's not something related to the client code.
retrieve()
as a workaround, but what I initially wanted to accomplish, I haven't.