MetadataComponentDependency

Represents dependency relationships between the metadata components in your org. You can query MetadataComponentDependency using Tooling API in API version 43.0 and later or using Bulk API 2.0 in API 49.0 and later.

As a Beta feature, MetadataComponentDependency (Dependency API) is a preview and isn’t part of the “Services” under your Main Services Agreement with Salesforce. Use this feature at your sole discretion, and make your purchase decisions based on the generally available products and features. Salesforce doesn’t guarantee general availability of this feature within any particular time frame or at all, and we can discontinue it at any time. This feature is for evaluation purposes only, not for production use. It’s offered as is and isn’t supported. Salesforce has no liability for any harm or damage arising out of the use of this feature. All restrictions, Salesforce reservation of rights, obligations concerning the Services, and terms for related Non-Salesforce Applications and Content apply equally to your use of this feature. You can provide feedback and suggestions in the Dependency API/Field Usage (Beta) Trailblazer Community group page.

Note

Version 

Introduced in API version 42.0.

Supported SOAP API Calls 

describeSObjects(), query()

Supported REST API Methods 

Query

Limitations 

Tooling API

  • No more than 2000 records in a single query.
  • Reports are not included in MetadataComponentDependency queries. Use Bulk API 2.0 for dependency relationships that include reports.

Bulk API 2.0

  • No more than 100,000 records in a single query.

The following SOQL queries are not supported in both Tooling API and Bulk API 2.0

  • 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 the RefMetadataComponentType field
  • SOQL OFFSET clause

SOQL Limitations

SOSL Limitations

Fields 

MetadataComponentId 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: The ID of a metadata component that depends on another component.

The component with the ID listed in the output as MetadataComponentId has a reference to the component with its ID listed as RefMetadataComponentId.

MetadataComponentId is a string field that usually contains either an 18-character ID or a standard object name. Use 18-character IDs, not 15-character IDs, in your queries of this field.

MetadataComponentName 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: The name of a metadata component that depends on another component. For example, YourClass for an Apex class or yourField (without the __c suffix) for a custom field.

The component with the name listed in the output as MetadataComponentName has a reference to the component with its name listed as RefMetadataComponentName.

MetadataComponentNamespace 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: The namespace of a metadata component that depends on another component.

The component with the namespace listed in the output as MetadataComponentNamespace has a reference to the component with its namespace listed as RefMetadataComponentNamespace.

MetadataComponentType 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: The type of a metadata component that depends on another component.

The component with the type listed in the output as MetadataComponentType has a reference to the component with its type listed as RefMetadataComponentType.

RefMetadataComponentId 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: The ID of a metadata component that another component depends on.

The component with the ID listed in the output as RefMetadataComponentId is referenced by the component with its ID listed as MetadataComponentId.

RefMetadataComponentId is a string field that usually contains either an 18-character ID or a standard object name. Use 18-character IDs, not 15-character IDs, in your queries of this field.

RefMetadataComponentName 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: The name of a metadata component that another component depends on. For example, YourClass for an Apex class or yourField (without the __c suffix) for a custom field.

The component with the name listed in the output as RefMetadataComponentName is referenced by the component with its name listed as MetadataComponentName.

RefMetadataComponentNamespace 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: The namespace of a metadata component that another component depends on.

The component with the namespace listed in the output as RefMetadataComponentNamespace is referenced by the component with its namespace listed as MetadataComponentNamespace.

RefMetadataComponentType 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: The type of a metadata component that another component depends on.

The component with the type listed in the output as RefMetadataComponentType is referenced by the component with its type listed as MetadataComponentType.

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!