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
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?