2GP Release Guide
This content is for the 1.0 version. Switch to the latest version for up-to-date documentation.
Ta treść nie jest jeszcze dostępna w Twoim języku.
Architecture
Section titled “Architecture”flowchart TB
subgraph DEVHUB["Dev Hub (Production)<br/>hello@tucario.com"]
PM["Package Manager<br/>(2GP packages)"]
NS["Namespace Registry<br/>(linked)"]
NS --> PM
end
DEVHUB --> NSORG
subgraph NSORG["Namespace Org (Dev Org)<br/>michal@tucario.com.flexifree<br/>Namespace: tucariofts"]
end
Prerequisites
Section titled “Prerequisites”1. Dev Hub (Production)
Section titled “1. Dev Hub (Production)”- Dev Hub enabled: Setup > Dev Hub > Enable
- Connected namespace: App Launcher > Namespace Registries > Link Namespace
2. Namespace Org (Partner Developer Org)
Section titled “2. Namespace Org (Partner Developer Org)”- Registered namespace (one-time, irreversible)
- Setup > Package Manager > Edit > Namespace Prefix
3. Local Environment
Section titled “3. Local Environment”- Salesforce CLI installed
- Authorization to both orgs
Quick Reference (Copy-Paste)
Section titled “Quick Reference (Copy-Paste)”# 1. Check orgssf org list
# 2. Check packagessf package list --target-dev-hub DevHub
# 3. Check versionssf package version list --packages FlexibleTeamShare --target-dev-hub DevHub
# 4. Create new version (BETA)sf package version create --package FlexibleTeamShare --installation-key-bypass --wait 20 --code-coverage --target-dev-hub DevHub --definition-file config/package-scratch-def.json
# 5. Test install (replace ID and org alias)sf package install --package 04tXXXXXXXXXXXXXXX --target-org TestOrg --wait 10
# 6. Promote to RELEASED (IRREVERSIBLE!)sf package version promote --package 04tXXXXXXXXXXXXXXX --target-dev-hub DevHubCommands
Section titled “Commands”Org Authorization
Section titled “Org Authorization”# Dev Hub (production)sf org login web --alias DevHub --set-default-dev-hub
# Namespace Org (dev org with namespace)sf org login web --alias FlexiFREECheck Connected Orgs
Section titled “Check Connected Orgs”sf org listCheck Existing Packages
Section titled “Check Existing Packages”sf package list --target-dev-hub DevHubCheck Package Versions
Section titled “Check Package Versions”sf package version list --packages FlexibleTeamShare --target-dev-hub DevHubCreating a New Package Version
Section titled “Creating a New Package Version”1. Update Version in sfdx-project.json (optional)
Section titled “1. Update Version in sfdx-project.json (optional)”{ "packageDirectories": [ { "versionName": "ver 0.2", "versionNumber": "0.2.0.NEXT", "path": "force-app", "default": true, "package": "FlexibleTeamShare" } ], "namespace": "tucariofts"}2. Create Package Version (beta)
Section titled “2. Create Package Version (beta)”sf package version create \ --package FlexibleTeamShare \ --installation-key-bypass \ --wait 20 \ --code-coverage \ --target-dev-hub DevHub \ --definition-file config/package-scratch-def.json3. Test Installation
Section titled “3. Test Installation”sf package install \ --package 04tXXXXXXXXXXXXXXX \ --target-org TestOrg \ --wait 104. Promote to Released (Production)
Section titled “4. Promote to Released (Production)”sf package version promote \ --package 04tXXXXXXXXXXXXXXX \ --target-dev-hub DevHubPublishing to AppExchange
Section titled “Publishing to AppExchange”- Log in to Partner Community
- Publishing > Listings > New Listing
- Add promoted package version
- Fill in listing details
- Submit for review
Troubleshooting
Section titled “Troubleshooting””Not available for deploy for this organization” (Translations)
Section titled “”Not available for deploy for this organization” (Translations)”Scratch org doesn’t have Translation Workbench enabled.
Solution: Use --definition-file config/package-scratch-def.json which includes:
{ "orgName": "Package Build Org", "edition": "Enterprise", "settings": { "languageSettings": { "enableTranslationWorkbench": true, "enableEndUserLanguages": true, "enablePlatformLanguages": true } }}“No such column” (FLS errors)
Section titled ““No such column” (FLS errors)”Use WITH SYSTEM_MODE instead of WITH USER_MODE in SOQL queries.
”You cannot deploy to a required field”
Section titled “”You cannot deploy to a required field””Remove required fields from permission sets (required fields don’t need FLS).