Example Analysis of DX Learning in Salesforce
This article introduces the example analysis of DX learning in Salesforce, the content is very detailed, interested friends can refer to it, I hope it can be helpful to you.
Salesforce DX learning
Log in to the developer center sfdx force:auth:web:login-d-a DevHub-a to create an alias-d set as the default organization
Create a folder mkdir folderName cd folderName
Clone
Git clone https://github.com/dreamhouseapp/dreamhouse-sfdx.git
Delete scratch
Sfdx force:org:delete
A scratch configuration
{"orgName": "Dreamhouse", "edition": "Developer", "hasSampleData": "false", "settings": {"orgPreferenceSettings": {"s1DesktopEnabled": true, "selfSetPasswordInApi": true, "s1EncryptedStoragePref2": false}
Create a Scratch Org and set it as the default sfdx force:org:create-s-f config/project-scratch-def.json-a dreamhouse-org
Opens the specified org sfdx force:org:open-u xxx
Push metadata to Scratch sfdx force:source:push
Assign permissions sfdx force:user:permset:assign-n xxxx
Import sample data sfdx force:data:tree:import-plan data/sample-data-plan.json
Create a package
You need to set DevHub as the default in sfdx and enable package.
Sfdx force:package:create-name dreamhouse-description "My Package"-packagetype Unlocked-path force-app-nonamespace-targetdevhubusername DevHub
-- name is the package name. This name is an alias you can use when running subsequent packaging commands.
-- path is the directory that contains the contents of the package.
Packagetype indicates which kind of package you're creating, in this case, unlocked.
Create version: sfdx force:package:version:create-p dreamhouse-d force-app-k test1234-- wait 10-v DevHub
-p is the package alias that maps to the package ID.
-d is the directory that contains the contents of the package.
-k is the installation key that protects your package from being installed by unauthorized individuals.
Convert to the official version:
Sfdx force:package:version:promote-p dreamhouse@1.0.0-1-v DevHub
Install into Org:
Sfdx force:package:install-- wait 10-- publishwait 10-- package dreamhouse@1.0.0-1-k test1234-r-u MyScratchOrg
This is the end of the sample analysis of DX learning in Salesforce. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.