Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

How to query the 'Metadata' field from 'FieldDefinition' with SOQL?

Asked by Aashna Saito Apr 19, 2023 6.9K views 1 answer
Share

About this question

I tried the following SOQL query:
select id, DataType,NamespacePrefix, DeveloperName, Metadata from FieldDefinition where EntityDefinition.QualifiedApiName = 'Account' AND DurableId ='Account.Industry'
I received this error:

INVALID_FIELD:

NamespacePrefix, DeveloperName, Metadata from FieldDefinition where ERROR at Row:1:Column:53 No such column 'Metadata' on entity 'FieldDefinition'.

Why? According to the documentation the field 'Metadata' is available if the query result contains no more than one record - which is the case here.

How can I access this field?

Your answer

1 Answer

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.