Unlocked Package - Package creation fails due to feature "Account.sharing" & "Account.RecordType"
Last updated 2020-11-13 ·Reference W-7267729 ·Reported By 84 users
For Unlocked Packaging these features "Account.Sharing" & "Account.RecordType" not yet supported feature in definition . So while creating a package version if there are any dependencies with these properties then that would fail.
1. Create a project
2. Login to dev hub
4. Put some resources (unzip force-app.zip which only incluses simple apex class)
5. Create a package (sfdx force:create:package -n AccountSharingTest -t Unlocked -r force-app
6. Modify your sfdx-project.json to add dependencies
"versionName": "ver 0.1",
7. Create a package version (sfdx force:package:version:create -p AccountSharingTest -w 30 -x -f config/project-scratch-def.json)
You will see following errors
Unlocked package version creation getting failed with an error : "An error occurred while trying to install a package dependency, ID 04t0I000000qrd6: Accounts Missing Organization Feature: Account.RecordType,An error occurred while trying to install a package dependency, ID 04t...: Accounts Missing Organization Feature: Account.Sharing"
To install successfully, some packages require that you define object-level sharing settings and default record types in the scratch org definition file before installation. Set the sharing settings and default record types with objectSettings.
The objectSettings option is a map. Each key is the lowercase name of an object, such as opportunity or account. The definition for each key is also a map with two possible values:
* sharingModel—Sets a sharing model. Different objects support different sharing models. Possible values of sharing models are:
* defaultRecordType—Creates a record type. This setting is required before installing a package that creates record types. Specify an alphanumeric string that starts with a lowercase letter.
In this sample scratch org definition file, we set a sharing model and a default record type for opportunity, and a default record type for account.
"features": ["Communities", "ServiceCloud", "Chatbot"],
Reported By (84)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.