Newer Version Available

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

Create and Deploy Your Package

Use these commands to create, update, and install the package.

Create the Package

Create a Package Version

The same command is used to create newer versions of the package. This command generates an installation link that can be used in customer orgs.

Release a Package Version

Each new package version is marked as beta when created. As you develop your package, you may create several package versions before you create a version that is ready to be released and distributed. Only released package versions can be listed on AppExchange and installed in customer orgs.

Before you promote the package version, ensure that the Promote a package version to released user permission is enabled in the Dev Hub org associated with the package. Consider creating a permission set with this user permission, and then assigning the permission set to the appropriate user profiles.

When you’re ready to release, use sf package version promote --package "Expense Manager@1.3.0-7"

If the command is successful, a confirmation message appears. Successfully promoted the package version, ID: 04tB0000000719qIAA to released.

After the update succeeds, view the package details. sf package version report --package "Expense Manager@1.3.0.7"

Confirm that the value of the Released property is true.
You can promote and release only one time for each package version number, and you can’t undo this change.

To learn more, see Workflow for Second-Generation Managed Packages.

Create a Scratch Org

You can create a scratch org to test your package. This process may take a few minutes. sf org create scratch --definition-file config/project-scratch-def.json --target-org <Dev Hub Username>

Open the Scratch Org

To find a list of scratch orgs, including the one you created, run this command.

sf org ist --verbose

To open the scratch org, run this command.

sf org open -u <scratch org username>

Install the Package

Before installing, make sure that the org has the Service Cloud Voice Partner Telephony license. Then, run this command:

sf package install --package "<Package Name>@<Package Version>" --target-org <Target Org Username>

Target Org is the org where you want to install the package.

Or, use the installation URL that’s created when you run the Salesforce CLI command for creating or promoting a package version.

Look for an email indicating whether the package was installed. If the installation failed, review the email for details and try again. To learn more about installation methods, see Use the CLI to Install a Second-Generation Managed Package.