1
SELECT  DataType,
        EntityDefinition.DeveloperName,
        IsCompound,
        DeveloperName,
        FieldDefinition.QualifiedApiName 
FROM    EntityParticle 
WHERE   EntityDefinition.QualifiedApiName ='Account'

When I run the above query using Tooling API, it is printing all the fields present on Account object as below:

DATATYPE      ENTITYDEFINITION.DEVELOPERNAME ISCOMPOUND DEVELOPERNAME                    FIELDDEFINITION.QUALIFIEDAPINAME
───────────── ────────────────────────────── ────────── ──────────────────────────────── ─────────────────────────────────────
textarea      Account                                   BillingAddress                   BillingAddress
string        Account                                   BillingAddress                   BillingAddress
string        Account                                   BillingAddress                   BillingAddress
string        Account                                   BillingAddress                   BillingAddress
string        Account                                   BillingAddress                   BillingAddress
picklist      Account                                   BillingAddress                   BillingAddress
picklist      Account                                   BillingAddress                   BillingAddress
double        Account                                   BillingAddress                   BillingAddress
double        Account                                   BillingAddress                   BillingAddress
picklist      Account                                   BillingAddress                   BillingAddress
address       Account                        true       BillingAddress                   BillingAddress

How can I adjust the above query so that fields like BillingStreet, BillingState appear in the output?

I am open to other options if they can satisfy these requirements:

  • Should return fields even if running user(System Admin) doesn't have FLS to those fields.(sfdx force:schema:sobject:describe is not returning fields if running user doesn't have FLS to the fields)
  • Need details like whether field is IsPermissionable or IsUpdatable and etc. This information seems to be available only in this object.
1

You need the QualifiedApiName field from the EntityParticle itself.

SELECT  DataType,
        EntityDefinition.DeveloperName,
        IsCompound,
        DeveloperName,
        QualifiedApiName,
        FieldDefinition.QualifiedApiName 
FROM    EntityParticle 
WHERE   EntityDefinition.QualifiedApiName ='Account'

does give you the individual field names, like BillingStreet, for each component particle of the compound field.

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.