2. 1. Agenda
● Unlocked package overview
○ What’s unlocked package
○ What’s it can do
○ What’s Its benefit compares to other package types
● How to use it (demo)
○ Create a package
○ Create a version
○ Install a beta version
○ Create a release version
○ Upgrading package
○ Unlocked package with dependencies
3. Before we begin
This workshop assumes that you are familiar with:
● Package development
● Salesforce DX
4. 1. Unlocked package overview
What’s unlocked package
● Salesforce offers several types of packages, each with unique
characteristics, and Unlocked Package is one of them.
● You can think about a package as a container that you fill with metadata. It
contains a set of related features, customizations, and schema.
● Unlocked package is especially suited for internal business apps
5. What’s it can do
Unless you plan to distribute an app on AppExchange, an unlocked package is
the right package type for most use cases.
You can use unlocked packages to:
● Add, edit, and remove metadata in your org in a trackable way.
● Organize your existing metadata.
● Package an app.
● Extend other packages or even an app that you’ve purchased from
AppExchange.
6. What’s it benefit
● Source-driven development model
● Iterate using versions
● Easy to add / edit / remove components
● Simplified CI / CD
● Dependency management
● Metadata organization
7. 2. How to use it (Demo)
- Create a package
- sfdx force:package:create --name wsHelloworld --description "Hello Package" --packagetype Unlocked --
path force-app --nonamespace --targetdevhubusername TrailheadPlayground_Devhub
- Create a version
- sfdx force:package:version:create -p wsHelloworld -d force-app -k test1234 --wait 10 -v
TrailheadPlayground_Devhub --codecoverage
- Install package
- By Command
- sfdx force:package:install --wait 10 --publishwait 10 --package wsHelloworld @1.0.0-1 -k
test1234 -r -u TrailheadPlayground_Devhub
- By URL
- packagingSetupUI/ipLanding.app?apvId=04t5g000000LSuYAAW
- Promote (release)
- sfdx force:package:version:promote -p wsHelloworld @1.0.0-1 -v TrailheadPlayground_Devhub
8. Unlocked package - Dependencies
● Dependencies example
● Install unlocked package with dependencies