1

Querying on Customfield using Tooling API in workbench is returning relationship label "null" even if object has the relationship field(lookup/master-detail). For Example: My Object has 3 relationship field. User (Lookup) Contact (Lookup) custom object (Master-Detail)

but on querying customfield relationshiplabel on rest explorer I am getting null for relationship label.

same result from developer console as well, here's my query.

Select+ID,DeveloperName,RelationshipLabel,SummaryOperation,ManageableState,NamespacePrefix,TableEnumOrId+from+CustomField+where+TableEnumOrId='01I1v000002GVYw'

I also tried to query RelationshipName instead of RelationshipLabel but it returned INVALID FIELD but it is mentioned in the document that we can use it here's the link: https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_customfield.htm

Does this field contain the correct data?

  • 1
    What's the purpose behind what you're trying to do? The fields, such as relationshipName, are part of the Metadata field. You would need to retrieve that to get the full details for the field. However, you can only retrieve one field at a time this way. You might want to look in to using a describe call instead. – sfdcfox Jun 10 at 13:10
  • My purpose of firing this query is retrieving no of relationship fields on custom objects, So I need to use tooling API just because I need to conect to other Orgs to fetch data using API so Schema Describe would not wok i suppose.I tried using just single field in my SOQL query but it still throws same error.And tableEnumOrId is my Object Id and not record for eg: Case – Sachin Jun 10 at 14:00
  • You can use describe calls in another org, though. you might want to do some more research. The tooling API is mostly for IDE developers. – sfdcfox Jun 10 at 14:05

Your Answer

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

Browse other questions tagged or ask your own question.