18

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 those sections, it really describes how and that unlocked packages were designed for such refactorings. How can I refactor my package? Let’s suppose you have ...


15

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 remove it from the package down the road in a subsequent package version. So the metadata item is no longer in the latest package version. When you install that ...


14

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 not available in Unlocked Packages. This is a great question, Robert! Thank you for asking it. I'll do my best to answer both parts of this question: Can ...


14

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" the same Dev Hub? Technically, they do not have to. There are some advantages in keeping them under the same DevHub. Most notably is that it leaves the ...


13

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 some internal/hidden scratch org to actually deploy package code there - to make sure that apex code and sobjects are valid? Yes, as on the reference docs "...


9

From the documentation you will need to specify dependency using dependencies property in the project-sfdx.json. { "packageDirectories": [ { "path": "atlas-quantum", "default": true, "package": "atlas-quantum", "versionName": "ver 0.1", "versionNumber": "0.1.0.NEXT", "dependencies": [ { ...


7

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 exists. Note, however, that a custom object has many related components, which of which may be unique. For example, you might have a custom object, and a dependent ...


7

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 the relevant section: The following list is given under the title "What permissions and settings are included?" for Permission Sets: Assigned custom ...


6

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 Package A ver 1.1.0 that has both the methods - global static void doFoo() and global static void doFoo(String msg). 2) Release Package B ver 1.1.0 where doBar(...


6

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 scratch org definition to the force:package:version:create command with the -f argument. You'd do something like this: sfdx force:package:version:create -p assured-...


6

The issue is happening because i was targeting the wrong hub-org.


6

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 (incorrect) source looked like: "dependencies": [ { "package": "utils", "versionNumber": "0.1.0.LATEST" }, { ...


6

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 hand edit the XML in the package. edit: or on a scratch org. They can be opened there. Flows & Processes are currently inaccessible through the UI on both ...


5

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:retrieve --packagenames=<package name> -r <directory path to retrieve> Looks like the team has fixed the issue with an unlocked package. Reach out ...


5

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

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, are valid. What does the usual force-app folder aim to? It's the default directory when you create a new project. It's just meant to serve as an example, ...


4

You have to enable quotes. The sfdx-project.json file has to have IsQuoteEnabled set.


4

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 -t Delete -u myAlias -w 10


4

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. This represents the version of the package to install. The 04t ID is returned when the force:package:version:create CLI command returns successfully. You can use ...


4

Yes, it's in the Account Settings area. Here's the relevant JSON to start from: { "settings": { "accountSettings": { "enableAccountTeams": true } } } See Scratch Org Definition Configuration Values for other settings. Edit: There appears to be values missing from the docs. I'll ask about this. However, I do know this ...


4

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 that was never installed will fail to deploy. This creates a big cat-and-mouse type problem for subscribers of these packages. To minimize this disruption, ...


4

It is all down to the fact Salesforce provides a multi-tenanted solution. Multiple orgs exist on the same virtual and physical servers. If there's heavy load on the server (across all the orgs that it supports) then Salesforce starts throttling processing performed in specific orgs, prioritizing user interactions and reducing capacity for async processing (...


4

A given installation may only take a short amount of time, but you also need to keep in mind that a deployment/installation requires "exclusive" access to certain tables, which are made read-only during that time. This is to guarantee atomicity (i.e. an installation can only fully succeed or fail). If you request to install five packages, then four ...


4

I have not tried this, but I don't think you could do. The Salesforce DX Developer Guide: Generate the Package Says: You can’t change the package namespace or package type after you create the package.


4

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 and scratch org definition. Just because you find suggestions as to how to achieve certain things, such as including profiles and sharing sets in the unlocked ...


3

There is no neat way of doing this, but you can go old-school. Upgrade all the packages in a sandbox, choosing to only compile the package when you install (which lets you make breaking changes sequentially). Then, use a conventional deployment of the key cross-over classes Foo and Bar (or just all changes) to production. Since they're unlocked, you can ...


3

From the Enable Dev Hub in Your Org article, it implies that you can only enable Dev Hub in the Partner Business org: Partner trial orgs signed up from the partner community have different scratch org limits. See Scratch Org Allocations for Partners. Partners can create partner edition scratch orgs: Partner Developer, Partner Enterprise, Partner Group, ...


3

In the following document youll find some common scenarios which might help - https://sfdc-db-gmail.github.io/unlocked-packages/faq-unlocked-pkgs.html#specify-pkg-dep When declaring dependencies you should match between your package aliases. "dependencies": [ { "package": "yourManagedPackageAlias" }, ...


3

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, we want it to be the same as .gitignore but we are using a very old library with no more traction: https://github.com/codemix/gitignore-parser We are looking at ...


3

So far you can't. The only thing you can run is Apex Classes compilation with the --apexcompile flag. However, starting Winter 21, code coverage should be enforced for Unlocked Packages installation. The original post from PM Dileep Burki is available here, feel free to go there and give your thoughts about it. Enforcement of Code Coverage in Unlocked ...


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