Skip to content

Instantly share code, notes, and snippets.

@shanerk
Created May 7, 2020 18:59
Show Gist options
  • Save shanerk/8ea23f6fc348ddca2177c07f291f5a62 to your computer and use it in GitHub Desktop.
Save shanerk/8ea23f6fc348ddca2177c07f291f5a62 to your computer and use it in GitHub Desktop.

Steps to Create DX Package Versions

Get Package Id

First you need the Package Id for your package. Package details can be obtained as follows:

sfdx force:package:version:report -p YOUR_PACKAGE_NAME

Ensure your sfdx-project.json has the Package ID and not the Subscriber Package Version Id set in this section:

"packageAliases": {
    "YOUR_PACKAGE_NAME": "YOUR_PACKAGE_ID"
  }

Create Version Procedure

To create a new version follow this procedure:

  1. Initiate a create version job:

    sfdx force:package:version:create -p "YOUR_PACKAGE_NAME" -x -f config/project-scratch-def.json

    Grab the JOB ID.

  2. Monitor the job (the JOB ID will be output from the create command above):

    sfdx force:package:version:create:report -i 08c46000000TND6AAO

    Replace 08c46000000TND6AAO with the JOB ID from step 1.

  3. Using the install URL output from the report command, go to the org where you wish to install it and append the URL to the orgs URL. Note that sandbox orgs (test.salesforce.com) will have the installer replicated up to 10 minutes later than the default org (login.salesforce.com).

    The URL will look similar to this: /packaging/installPackage.apexp?p0=04t460000023dbMAAQ

    The last section after p0= is your SUBSCRIBER PACKAGE ID.

    To see a list of existing release URLs:

    sfdx force:package:version:list

    To install an older version, copy the SUBSCRIBER PACKAGE ID into the URL as shown above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment