When we create unmanaged packages, if we add a Lightning app in the component list, Salesforce automatically adds all the related components - Apex classes, Objects, Fields, Custom settings, etc. in that unmanaged package.

Does Salesforce provides a way to achieve this (finding component dependencies) from apex using any api?


You can check the dependencies between components using the Tooling API SymbolTable. Specifically the externalReferences

Contains the name, namespace, and external class, method and variable references for the Apex class or trigger. These references can be used for symbol highlighting or code navigation.

If the SymbolTable isn't available for the ApexClass you will need to force a compile first. See Trying to get SymbolTable of an Apex class and get null.

Based on my previous answer to How to find Dependent Components for a Class/Page/Trigger using API (Tooling or Metadata API)?


If you build any component,if you referred that component different placess

  • Using "Sublime" you can easily find where the components is used

    If you trying to delete any components,that time also It shows the dependent components (suppose you are deleting component is child of any other components)

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.