Search code examples
salesforcesoql

Salesforce/SOQL: How to retrieve all column names from Account?


I am trying to retrieve all the column names from Salesforce by SOQL Query that I get via Pentaho as well with the following code

select QualifiedApiName
from FieldDefinition 
where EntityDefinition.DeveloperName='Account'

Pentaho lists 65 fields, the query only 50. The following fields are missing (list contains 16 instead of 15 fields for some reason)

BillingStreet
BillingCity
BillingState
BillingPostalCode
BillingCountry
BillingLatitude
BillingLongitude
BillingGeocodeAccuracy
ShippingStreet
ShippingCity
ShippingState
ShippingPostalCode
ShippingCountry
ShippingLatitude
ShippingLongitude
ShippingGeocodeAccuracy

Would you mind telling me the SOQL code I need in order the get all the 65 fields? Would appreciate that!


Solution

  • The fields you've listed are components of compound fields, specifically the ShippingAddress and BillingAddress compound Address fields.

    What you want is most likely to write your query against EntityParticle in the Tooling API, which should give you parity. But fundamentally it's important to know that neither list is wrong - your query and Pentaho are just using APIs that have slightly different definitions of what a field is, in the complicated situation around compound fields.

    You could also write REST API calls against the Describe API, if you're not limited to using just SOQL.