0

I am trying to use tooling API to do some dynamic metadata analysis and I have it a roadblock. While trying to execute a simple anonymous query using below

/services/data/v51.0/tooling/query/?q=select+Contract_Discount__c+from+Quote_Trending_History__c

I am getting following error in executing this query

[{'message': "sObject type 'Quote_Trending_History__c' is not supported.", 'errorCode': 'INVALID_TYPE'}]

I am able to execute the same query from workbench soql tab but when using REST explorer or workbench it gives the same error. I have confirmed both the queries are being executed using same user so it cannot be permission issue. The user being used for this is a System Administrator.

1 Answer 1

1

The Tooling API doesn't support standard record objects. It's meant to be a way to access metadata objects, such as ApexClass and CustomField, particularly in a way that you'd use it for "tooling" (meaning, an API for Integrated Development Environment, or IDE, to be used for development of features and fixing bugs).

To perform a query in the REST API, use the normal API:

/services/data/v51.0/query?q=select+Contract_Discount__c+from+Quote_Trending_History__c

If you wanted to get metadata about a custom field, for example, you might use a Tooling API query like this:

/services/data/v51.0/tooling/query?q=select+metadata+from+customfield+where+TableEumOrId='tableId'+and+developername='contract_discount'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .