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
Sunad RasaneSunad Rasane 

Getting "Line: 13432, Column: 1 System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: INVALID_TYPE: This type of object is not available for this organization faultcode=sf:INVALID_TYPE faultactor=" on metadata API.

I am working on the Metadata API to create an Apex trigger dynamically. I have used Apex Wrapper Salesforce Metadata API from Github-  https://github.com/financialforcedev/apex-mdapi.

The error is- 
System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: INVALID_TYPE: This type of object is not available for this organization faultcode=sf:INVALID_TYPE faultactor=

ShirishaShirisha (Salesforce Developers) 
Hi Sunad,

Greetings!

Can you please double check the API name that you are using as well as the permissions on the same Objects are given to the specific user profile with which you are trying to access.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
Sunad RasaneSunad Rasane

Hi Shirisha,

The issue is now solved. I have used the tooling API.

If anyone having a similar issue please check on stack exchange in below post-
https://salesforce.stackexchange.com/questions/301169/system-calloutexception-invalid-type-this-type-of-object-is-not-available-for/301170#301170 

Thanks for your response.