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

1sfdx force:package:create --name "<Package Name>" --path force-app --packagetype Managed --errornotificationusername <Dev Hub Username>

Create a Package Version

1sfdx force:package:version:create --package "<Package Name>" --codecoverage --installationkeybypass --wait 20

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.

1Successfully created the package version [08cB0000000****IA0]. Subscriber Package Version Id: 04tB0000000d****IAQ
2Package Installation URL: https://login.salesforce.com/packaging/installPackage.apexp?p0=04tB00000****DIAQ (https://login.salesforce.com/packaging/installPackage.apexp?p0=04tB0000000d2wDIAQ)

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 the 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 force:package:version:promote. sfdx force: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. sfdx force:package:version:report --package "Expense Manager@1.3.0.7"

Confirm that the value of the Released property is true.
1=== Package Version
2NAME VALUE
3────────────────────────────── ───────────────────
4Name ver 1.0
5Alias Expense Manager-1.0.0.5
6Package Version Id 05iB0000000CaahIAC
7Package Id 0HoB0000000CabmKAC
8Subscriber Package Version Id 04tB0000000NPbBIAW
9Version 1.0.0.5
10Description update version
11Branch
12Tag git commit id 08dcfsdf
13Released true
14Created Date 2018-05-08 09:48
15Installation URL
16https://login.salesforce.com/packaging/installPackage.apexp?p0=04tB0000000NPbBIAW
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 Packages.

Create a Scratch Org

You can create a scratch org to test your package. This process may take a few minutes. sfdx force:org:create --definitionfile config/project-scratch-def.json --targetusername <Dev Hub Username>

Open the Scratch Org

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

sfdx force:org:list --verbose

To open the scratch org, run this command.

sfdx force: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:

sfdx force:package:install --package "<Package Name>@<Package Version>" --targetusername <Target Org Username>

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

Or, use the installation URL that’s created when you run the sfdx 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 Install Packages with the CLI.