Querying Tooling Tables
Querying Tooling Tables
Salesforce has tables, called tooling tables, within the Salesforce Tooling API. You can use tooling tables to access Salesforce metadata.
Below are examples of queries that use tooling tables to return Salesforce metadata:
SELECT * FROM Cdata2.cdata.salesforce.EntityDefinition WHERE QualifiedApiName like 'Account%'
SELECT * FROM Cdata2.cdata.salesforce.FieldDefinition WHERE EntityDefinitionId = 'Account'
SELECT * FROM Cdata2.cdata.salesforce.EntityParticle WHERE EntityDefinitionId = 'Account'
SELECT * FROM Cdata2.cdata.salesforce.Relationshipdomain WHERE ParentsObjectid = 'Account'
For more information about the Salesforce Tooling API, see Tooling API Objects in the Salesforce developer documentation.