Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Package Version entry
How-to guide

Create and manage Package Versions

Working with Package Versions spans the developer-side creation workflow, the testing and promotion workflow, and the ongoing version-lifecycle management. The walkthrough below covers the standard sequence for releasing a new package version from a Salesforce DX project.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated May 19, 2026

Working with Package Versions spans the developer-side creation workflow, the testing and promotion workflow, and the ongoing version-lifecycle management. The walkthrough below covers the standard sequence for releasing a new package version from a Salesforce DX project.

  1. Set the target version in sfdx-project.json

    Update the project's sfdx-project.json file to set the new version number. The versionNumber field follows the major.minor.patch.NEXT pattern, where NEXT auto-increments the build number during package version creation. Increment the major, minor, or patch number based on the nature of the changes per semantic versioning. Document the version's changes in a changelog before building.

  2. Build the new package version

    Run sf package version create with the appropriate flags: the package alias, version number override if needed, the ancestor version, any test running options. The command validates the source, runs the configured tests, and produces a beta version with a 04t Id. The build can take minutes to hours depending on the package size and test complexity. Capture the 04t Id; this is the package version's unique identifier.

  3. Test the beta version in scratch orgs and sandboxes

    Install the beta version in scratch orgs that simulate customer environments. Run the standard test scenarios: install on a clean org, install on an org with the previous version (upgrade test), exercise all major features, verify that any breaking changes are documented and acceptable. Engage pilot customers if appropriate. Iterate on the version with additional beta builds if bugs surface. The testing burden is what gates the promotion to released; do not rush this step.

  4. Promote to released and distribute

    Once the beta version passes all testing, run sf package version promote to mark it as released. The version becomes immutable. Update the AppExchange listing or internal distribution channels with the new install URL. Communicate the release to subscribers through the standard channels. Schedule the retirement of older versions on a defined cadence. The new version is now the canonical install for new customers, with existing customers choosing when to upgrade.

Gotchas
  • Released versions are immutable. Changes require a new version, not edits to the existing one.
  • Ancestor declarations affect upgrade compatibility. Misconfigured ancestors break the upgrade path for subscribers.
  • Beta versions cannot be installed in production. Only released versions are eligible for general distribution.
  • Dependencies must be declared explicitly. Forgetting a dependency causes install failures in subscriber orgs.
  • Version retirement does not affect existing installs. Subscribers continue to use retired versions until they explicitly upgrade.

See the full Package Version entry

Package Version includes the definition, worked example, deep dive, related terms, and a quiz.