Share Your Experience With Others

How to get standard picklist fields on Salesforce objects using SOQL query

SELECT EntityDefinition.QualifiedApiName, QualifiedApiName, DataType FROM FieldDefinition WHERE DataType = ‘Picklist’ and EntityDefinition.QualifiedApiName IN (‘Account’, ‘Opportunity’, ‘Lead’, ‘Product’, ‘Contract’) AND (NOT QualifiedApiName like ‘%__c’)

Add the relevant standard object API name like we have added Account, Opportunity, Lead and others.

Leave a comment