Salesforce EntityParticle
Entity Particle
Represents each element of a field that can be presented in a user interface. Contrast EntityParticle with FieldDefinition, which represents each element of a field defined in the Metadata API. EntityParticle has parity with describe, which returns API-accessible fields only for an entity.
Let's say there is a requirement to fetch all picklist fields along their label, API Name.
SOQL query using Entity Particle
SELECT EntityParticle.DeveloperName, Label, Value, IsActive, EntityParticle.IsDependentPicklist, EntityParticle.FieldDefinition.ControllingFieldDefinition.DeveloperNameFROM PicklistValueInfo
WHERE EntityParticle.EntityDefinition.QualifiedApiName = 'Case'
AND EntityParticle.IsDependentPicklist = TRUE
ORDER BY EntityParticleId, Label
Results
Retrieve all the fields of the 'Phone' data type


Comments
Post a Comment