Understand Dependencies Between Metadata Components in Your Org Using the MetadataComponentDependency Object in Bulk API 2.0 (Beta)
Where: This feature is currently available only in sandboxes. To use Bulk API 2.0, the API Enabled permission must be enabled.
Why: Salesforce orgs can get messy due to unchecked growth of inefficient customization and integrations, resulting in an org that is cluttered and unscalable. Finding the relationships between metadata components in your org can help you reduce complexity and unclutter your Salesforce org.
How: In previous releases, this type of query was accessible using Tooling API only. You can now query the MetadataComponentDependency object using Tooling API endpoints in Bulk API 2.0. To create a query job, issue a REST API POST request and include your SOQL query statement in the body of the request. For example,
/services/data/v49.0/tooling/jobs/query HTTP/1.1
{ "operation": "query", "query": "select MetadataComponentType FROM MetadataComponentDependency“ }
- Only queries against the MetadataComponentDependency object are supported using the /services/data/vXX.X/tooling endpoint in Bulk API 2.0.
- Requests are returned in CSV format.
- You can also filter your query by adding a WHERE clause to narrow the results.
The following table lists the URIs and methods supported by Bulk API 2.0 for MetadataComponentDependency queries.
Description | URI | HTTP Method |
---|---|---|
Creates a query job. | /services/data/vXX.X/tooling/jobs/query | POST |
Gets information about all query jobs in the org. | /services/data/vXX.X/tooling/jobs/query | GET |
Gets information about one query job. | /services/data/vXX.X/tooling/jobs/query/queryJobId | GET |
Gets the results for a query job. | /services/data/vXX.X/tooling/jobs/query/queryJobId/results | GET |
Aborts a query job. | /services/data/vXX.X/tooling/jobs/query/queryJobId | PATCH |
Deletes a query job. | /services/data/vXX.X/tooling/jobs/query/queryJobId | DELETE |
The following SOQL queries are not supported.
- SOQL ORDER BY clause
- SOQL SELECT clause—count() function
- SOQL queryMore()
- SOQL WHERE clause—Any type of filter with MetadataComponentName
- SOQL WHERE clause—Any type of filter with RefMetadataComponentName
- SOQL WHERE clause—Contains operators other than =, !=, AND, or OR
- SOQL WHERE clause—Filter by (RefMetadataComponentType = 'StandardEntity')
- SOQL WHERE clause—Use of the LIKE operator with either the MetadataComponentType field or RefMetadataComponentType field
- SOQL OFFSET clause