Newer Version Available

This content describes an older version of this product. View Latest

Understanding Dependencies

AppExchange packages and Visualforce are available in: Group, Professional, Enterprise, Performance, Unlimited, and Developer Editions
Apex available in: Enterprise, Performance, Unlimited, and Developer Editions

User Permissions Needed
To upload packages: “Upload AppExchange Packages”
To view Apex dependencies: “Author Apex
To view Visualforce dependencies: “Developer Mode”
Package dependencies are created when one component references another component, permission, or preference that is required for the component to be valid. Force.com tracks certain dependencies, including:
  • Organizational dependencies, such as whether multicurrency or campaigns are enabled
  • Component-specific dependencies, such as whether particular record types or divisions exist
  • References to both standard and custom objects or fields

Packages, Apex classes, Apex triggers, Visualforce components, and Visualforce pages can have dependencies on components within an organization. These dependencies are recorded on the Show Dependencies page.

Dependencies are important for packaging because any dependency in a component of a package is considered a dependency of the package as a whole.

An installer’s organization must meet all dependency requirements listed on the Show Dependencies page or else the installation will fail. For example, the installer's organization must have divisions enabled to install a package that references divisions.

Note

Dependencies are important for Apex classes or triggers because any component on which a class or trigger depends must be included with the class or trigger when the code is deployed or packaged.

In addition to dependencies, the operational scope is also displayed on the Show Dependencies page. The operational scope is a table that lists any data manipulation language (DML) operations (such as insert or merge) that Apex executes on a specified object. The operational scope can be used when installing an application to determine the full extent of the application’s database operations.

To view the dependencies and operational scope for a package, Apex class, Apex trigger, or Visualforce page:
  1. Navigate to the appropriate component from Setup:
    • For packages, click Create | Packages.
    • For Apex classes, click Develop | Apex Classes.
    • For Apex triggers on standard objects, click Customize, click the name of the object, and then click Triggers.
    • For Apex triggers on custom objects, click Create, click the name of the object, and then click Triggers.
    • For Visualforce pages, click Develop | Pages.
  2. Select the name of the component.
  3. Click View Dependencies for a package, or Show Dependencies for all other components, to see a list of objects that depend upon the selected component.

If a list of dependent objects displays, click Fields to access the field-level detail of the operational scope. The field-level detail includes information, such as whether a field is updated by Apex. For more information, see Field Operational Scope.

Packages, Apex code, and Visualforce pages can be dependent on many components, including but not limited to:
  • Custom field definitions
  • Validation formulas
  • Reports
  • Record types
  • Apex
  • Visualforce pages and components

For example, if a Visualforce page includes a reference to a multicurrency field, such as {!contract.ISO_code}, that Visualforce page has a dependency on multicurrency. If a package contains this Visualforce page, it also has a dependency on multicurrency. Any organization that wants to install this package must have multicurrency enabled.