Package Dependencies

Updated 3 weeks ago by Copado Solutions

Package Dependencies Overview

The package dependencies feature allows you to make Salesforce packages dependent on each other. You can now develop and maintain a set of interdependent packages with the flexibility to promote them separately in a modular way.

Package dependencies are available for unlocked packages and second-generation packages (2GP). Unlocked packages can hold dependencies with other unlocked packages or 2GP.

Creating a Package Dependency

In order to create a package dependency in Copado, follow the steps below:

  1. Navigate to the Package Dependencies related list in the unlocked package or 2GP Package record.
  2. Click on New.
  3. Fill in the relevant fields in the Package Dependency record:

  • Dependent Package: Designates the package record which cannot be installed or managed without the depending one.
  • Depending Package: The depending Salesforce package which contains required dependencies for the metadata of the dependent package.
  • Depending Package Version: The minimum or exact version of the depending package. This particular version will be used during version creation and installation operations.
  • Depends on the latest version: If checked, the latest version of the depending package is used when creating a new version and for installation operations.
  1. Once a dependency record is created, you will need to generate a new version of the package so that the new version is aware that it has a dependency. To generate a new version, click on Generate New Version in the unlocked package or 2GP Package record.

Package dependencies can be seen at the moment of loading metadata into a scratch org.

  1. In the first step in the Scratch Org Wizard, from the metadata sources available, select Unlocked Packages or Second-Generation Packages.
  2. In the next screen, enter the Sfdx Project details.
  3. Select a package and a version and click on Add to Selection.

  1. If the selected package has any packages dependent on it, they will be selected automatically. You can scroll down to the Selected Packages section where all the packages selected will be listed.
  • Firstly, you will see the package you have selected. The Included by column value will be User Selected.
  • Secondly, you will see all the dependent packages. The Included by column value will be the name of the main package.

How did we do?