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 ...
Robert Sösemann's user avatar
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 ...
Vivek M. Chawla's user avatar
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 ...
Doug's user avatar
  • 460
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" ...
ImJohnMDaniel's user avatar
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 ...
ImJohnMDaniel's user avatar
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": ...
Mohith Shrivastava's user avatar
11 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 ...
Phil W's user avatar
  • 35.4k
10 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:...
Mohith Shrivastava's user avatar
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 ...
sfdcfox's user avatar
  • 487k
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, ...
sfdcfox's user avatar
  • 487k
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.
NSjonas's user avatar
  • 10.1k
7 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 ...
David Reed's user avatar
  • 92.6k
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 ...
Aidan's user avatar
  • 13.6k
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 ...
Dileep's user avatar
  • 206
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 (...
sfdcfox's user avatar
  • 487k
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 ...
akarnid's user avatar
  • 1,984
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 ...
sfdcfox's user avatar
  • 487k
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.
Daniel Ballinger's user avatar
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 ...
sfdcfox's user avatar
  • 487k
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. { "...
sfdcfox's user avatar
  • 487k
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 ...
sfdcfox's user avatar
  • 487k
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 ...
David Reed's user avatar
  • 92.6k
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.
Jason Hardy's user avatar
4 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 ...
Aidan's user avatar
  • 13.6k
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 ...
sfdcfox's user avatar
  • 487k
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. ...
ddeve's user avatar
  • 1,566
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 ...
sfdcfox's user avatar
  • 487k
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, ...
sfdcfox's user avatar
  • 487k
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 ...
sfdcfox's user avatar
  • 487k
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 ...
Mohith Shrivastava's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible