Create an Unlocked/Managed Package
Last updated
Was this helpful?
Last updated
Was this helpful?
If you’re new to packaging, you can think about a package as a container that you fill with metadata. It contains a set of related features, customizations, and schema. You use packages to move metadata from one to another.
There are two kinds of packages - managed and unlocked packages.
Unlocked packages allow the users a means to organize their metadata into a package and then deploy the metadata (via packages) to different org. Unlocked packages will help the users to add, edit, and remove metadata in their org in a traceable way. The users can apply their source and metadata to multiple org, and upgrade their Salesforce apps easier and faster.
Managed packages are created by Salesforce partners to distribute and sell apps to their customers. The main purpose of a managed package is to bind code and configuration elements into a single entity. Those can be logical functional modules, re-usable code libraries, or entire sub-systems containing the functionality of a business channel.
The key benefits of managed packages are the following:
Intellectual property protection is automatically included in certain components, e.g., in obfuscating Apex code.
API accessible components have integrated versioning support.
A previous version of the app can be branched and patched.
You can seamlessly provide subscribers with patch updates.
You can give unique names to components to avoid conflicts when installing the app.
You can select the desired ancestor while creating a package version.
There are two steps to follow:
The first step is to create a package, specifying information that is unlikely to change, like the package name and description.
The second step is to create a package version of the package. This package version is the artifact that is installed in various orgs. As you update your app, you create new package versions containing the updated source.
Click Create Package.
On the next screen, give the Package Name and the Package Description.
Select the Package Type: Unlocked or Managed.
Select the Dev Hub for which the package will be associated.
What is a Package Version?
Under the Package Version section, do the following:
Version Name: Version name gets auto-generated based on the package name. However, you can edit the name and enter your desired name. It is really up to you.
Version Description: Brief description of your Package version.
Version Number: Version numbers are formatted as major.minor.patch.build (1.2.1.8)
Installation Key: Enter the installation key that protects your package from being installed by unauthorized individuals.
Tag: Enter the tag that is required to release the package. For ex- Release 1.0.0
Package Dependencies: The Dev Hub org can own multiple packages that are created in AutoRABIT. Such dependent packages will get displayed in this section.
Click either View Metadata or Create Package.
View Metadata: This option will allow the users to view the metadata types and their members that get pulled out from the Version control repository and review the same before creating a package.
Create Package: This will allow you to create the package for the data that you've filled above.
Upon confirmation, the package gets created and the progress status gets displayed on the Unlocked Package home screen.
Status: View the status of the Package i.e., success or failed along with the Package Log report.
Actions:
Delete a Package: Delete a package and its related version details. This process cannot be undone!!
Create a Version: Using the + icon to create a new package version for the current package. On the next screen, fill in the basic details such as version name, version number, installation key, tag, and description and click Create.
Info:
Promote: With this option, you promote your package versions to be released. A version number uses the format major.minor.patch.build. When you promote a package version, you cannot promote the same package again unless you increment the minor or major number. For example- if you created and promoted package 1.0.0.2, you can create packages 1.0.0.3, 1.0.0.4, and so on. However, you cannot promote more packages with the 1.0.0 scheme. To promote another package, create a new package with an incremented major or minor version number.
Package info: Hover your mouse over the info icon to view the package information such as package author name, date and time stamp of the package created, package last modified date/time, and the author who did the last modification.
Hover your mouse over the module and select the option: Packages
Under Version Control, enter the and its related Branch.
Select the Package Directory from the dropdown. (For more information about Package Directory, refer to the article: )
A package is a container for . It represents a distinct deployable unit of functionality that is iterated over time. You can add metadata to a package and take a snapshot of it, anytime. This snapshot is called a package version. You can create package versions any number of times. Each package version, once created, is immutable and is associated with a single package. You can install a package version in any Salesforce environment - scratch orgs, sandbox orgs, or production orgs. Installing a package version deploys the metadata that was specified when the package version was created.
From the Available Packages list, select the dependent packages that will be associated with the current module. Use the / button to add/remove the dependent packages to the module and using the / button, move the package list up and down. Based on the selection, the top package will be deployed in the beginning and the process continues for the remaining dependent packages.
View Packaged versions (): You can click on this icon to view the version details (package version name, version number, percentage of code coverage covered, etc.,) of an unlocked or managed package. Alternatively, you can click on the package name on the Packages screen to view the version details. The installation URL for the package version gets auto-generated and used in creating a package. You can add a new version to the current package by clicking Create Package Version.