19
votes
Accepted
Can we move metadata between Unlocked Packages?
John answered the question already very well but I want to draw your attention to this hidden documentation gem by the Packaging PM Dileep Burki. It helped to feel safe with Unlocked Packages.
In ...
17
votes
Accepted
Should DX Unlocked packages be used for app distribution to customers
TLDR: No, Unlocked Packages cannot be used like this. Anyone commercially distributing a Salesforce app must do so using Managed Packages. Also, Managed Packages offer many valuable features simply ...
15
votes
Accepted
SFDX: Create unlocked package version - What is happening behind the scene?
I can answer some of these I think. At least we are now creating new unlocked package versions and promoting them. Our unlocked package version does depend on two managed packages.
1 - Does SF use ...
15
votes
Accepted
Can Unlocked Packages only modularize a single project / repo / org?
You can definitely take a single org and split it to multiple packages and multiple repos (one repo per package) and define the dependencies wherever they occur.
Would they all need to "live under" ...
15
votes
Can we move metadata between Unlocked Packages?
Is there a process that allows us to safely move a piece of metadata from a package to one of its dependent packages?
Yes. Once a piece of metadata is released via an unlocked package, you can ...
12
votes
Accepted
Can we download the contents of an Unlocked Package?
The package can now be retrieved using one of of the below approach
sfdx force:source:retrieve -n <package name>
or if you need package.xml and in metadata API format use below
sfdx force:mdapi:...
12
votes
Accepted
How do I package an upgradable Experience Builder Site?
This seems so simple on the face of it, but ends up quite difficult to achieve. I did manage, and on the way learned quite a bit. The main learning points:
You have to have just the right metadata ...
11
votes
Accepted
Unlocked Package Dependencies
From the documentation you will need to specify dependency using dependencies property in the project-sfdx.json.
{
"packageDirectories": [
{
"path": "atlas-quantum",
"default": ...
9
votes
Accepted
Cannot add component to another package because it is an installed component
Generally, is it possible to install two unlocked packages that share overlapping Metadata, e.g. the same custom object?
One would need to be a dependent of the other if the exact same metadata ...
8
votes
Accepted
Error running sfdx force:package:version:create
Package version creation takes place in a scratch org, whose configuration must meet the minimum requirements for your package's metadata in order for it to be deployed there.
You can specify a ...
8
votes
Accepted
Project structure and modular development best practices
While researching about this practice, I found different examples:
Yes, these are two Salesforce-published examples, two different possible ways to organize metadata. Both of these, and other ways, ...
7
votes
sfdx force:package:version:create The provided package ID '0Hoxxxxx' is invalid
The issue is happening because i was targeting the wrong hub-org.
7
votes
Accepted
Permission set is deployed with unlocked package, but is missing permission. What could be the reason?
The link from @xedshot (https://help.salesforce.com/articleView?id=distribution_perm_sets_profile_settings.htm&type=5) is correct and relevant, but I feel that it's worth quoting and explaining ...
6
votes
Accepted
SFDX: Entities not supported on package version creation
The gaps can be irritating, but it is all spelled out in the Metadata Coverage Report here:
https://developer.salesforce.com/docs/metadata-coverage/47
So, you might have to live with keeping them ...
6
votes
Accepted
Nested Unlocked Packages requires Installation of Base Packages?
After carefully checking the JSON source, I realized that the dependencies were out of order. You must list the dependencies in the order that they depend upon each other.
In other words, the (...
6
votes
Upgrading multiple packages at once
On our product roadmap, we have plans to support installing and upgrading multiple packages in a single transaction.
Until that is available, would this multi-step process work for you?
1) Release ...
6
votes
Accepted
Flow from Unlocked DX package can not be changed in subscriber org. Why?
This is the bug: https://success.salesforce.com/issues_view?id=a1p3A0000003UVoQAM
horrible stuff and I hope they put effort into getting this fixed. The only way to edit the flows currently is to ...
5
votes
Accepted
Change version number scheme in sfdx-project.json
This isn't currently allowed because it's not necessarily a good idea. The way versions work in Salesforce is that each version installed is tracked by the platform. Metadata that depends on a version ...
5
votes
Accepted
Using Apex to mimic semantic string versioning (to validate “increment only” logic to a text field that represents semantic version
One option would be to use the native Version class that Apex provides.
This will give you major, minor, and patch numbers.
Plus there is an existing compareTo(version) method.
5
votes
Accepted
Remove component from Unlocked Package programmatically
The intended path would be to update both the original package to no longer include the component, then include the component in the new package. Rather than removing from the UI, you can use the ...
5
votes
Accepted
Include two different package Directories during unlocked package creation
No, you're not missing anything. Each package may only be one directory. From your question, it appears you want two packages, with the force-app package depending on the common package.
{
"...
5
votes
Accepted
Converting application to deploy Using unlocked packages
If we do go with unlocked packages, is there anyway we can have both projects installed at the same time, and eventually migrate to the unlocked package version? We don't want to destroy our ...
5
votes
Accepted
Where is unlocked package version metadata stored?
The actual metadata storage for packages is opaque to you as an end user: it is inside the Salesforce platform.
When you upload a package, you receive an 04t package version id. That id uniquely ...
4
votes
Accepted
Create Package Version Error: Entity Quote not found
You have to enable quotes.
The sfdx-project.json file has to have IsQuoteEnabled set.
4
votes
Upgrade unlocked package fails due to "Cannot use unfiled-public or user folders in a package"
I don't have an easy way to determine this immediately, but it may be due to the default upgrade type of Mixed. Try using the Delete mode instead:
sfdx force:package:install -p the_package_to_install ...
4
votes
Accepted
Unlocked Packages - Install using URL
Here is how to install via UI or CLI which includes:
Salesforce UI
By appending the following to the browser URL: packaging/installPackage.apexp?p0=<04t id>
The 04t is the package version ID. ...
4
votes
Accepted
Enable Account Teams in scratch org definition file
Yes, it's in the Account Settings area. Here's the relevant JSON to start from:
{
"settings": {
"accountSettings": {
"enableAccountTeams": true
}
}
}
See Scratch ...
4
votes
Accepted
How to use forceignore to ignore all fields on an object and add exceptions
According to a previous answer, forceignore works slightly different than normal gitignore; they're using an "older version" of the lib that provides this functionality (see this Tweet).
Ideally, ...
4
votes
Organize Managed Package Dependencies with Unlocked Packages
Why is that a requirement?
Because it is intended that those packages will become part of a Classic Managed Package (1GP). This restriction prevents you from accidentally creating dependencies on a ...
4
votes
Organize Managed Package Dependencies with Unlocked Packages
One viable solution would be to directly clone the source code from git repo of these open source libraries into your project folder.
You can subfolders under the main folder as discussed by one of ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
unlocked-package × 267salesforcedx × 132
managed-package × 42
package × 34
salesforcedx-cli × 25
2gp × 23
deployment × 14
scratch-org × 11
isv × 11
package-dependency × 11
apex × 10
unmanaged-package × 10
second-generation-packaging × 10
2gp-ama × 10
cicd × 9
appexchange × 7
versioning × 7
code-coverage × 6
custom-metadata × 6
namespace × 6
package-install × 6
scratch-org-definition-file × 6
dev-hub × 6
experience-bundle × 6
unit-test × 5