1

I'm trying to use the SOAP version of the Winter 13 (v29.0) Tooling API to query the CustomField records and the associated CustomFieldMetadata Metadata field.

The following query works without the Metadata field:

Select Id, DeveloperName, FullName, NamespacePrefix, TableEnumOrId from CustomField where TableEnumOrId = 'Contact' order by DeveloperName limit 100

SOQL query against the Tooling API for CustomField

If I add the Metadata field to the query I get an error back from the API:

Select Id, DeveloperName, FullName, NamespacePrefix, TableEnumOrId, Metadata from CustomField where TableEnumOrId = 'Contact' order by DeveloperName limit 100

System.Web.Services.Protocols.SoapHeaderException]: {"Unable to serialize property of 'records' on type common.api.soap.wsdl.QueryResult Error Id: 716379696-38882 (-43640737)"}


The same SOQL query works in the developer console in a Spring 14 Org when "Use Tooling API" is checked. The developer console only shows the Metadata as "[object Object]".

I can't be sure, but I suspect the developer console is using the REST API. At the very least it shows it should be possible to get the field with SOQL.

Is this a Spring 14 vs. Winter 13 difference, or a SOAP vs. REST thing?

1

From the Tooling API documentation for CustomField.Metadata

Query this field only if the query result contains no more than one record. Otherwise, an error is returned. If more than one record exists, use multiple queries to retrieve the records. This limit protects performance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.