Scratch Orgs
Scratch are new type of environment that are introduced with salesforceDX. Scratch orgs are fully customizable allowing developers to emulate different editions with different features and preferences.
You don't have to worry about credentials, after all scratch orgs are disposable and used for short period of time. when scratch org is created it does not contain any data, metadata or code from production environment. You can pull down code and customizations from devhub.
This demo explains how to create, open and delete scratch orgs.
Before creating scratch orgs , login and authenticate to DevHub enabled org, for details clickhere
Commands listed down below :
sfdx force:org:create -s -f config/project-scratch-def.json -a myorg1 --durationdays 7
sfdx force:org:open
sfdx force:org:delete -u myorg1
-s : set defaultusername
-f: definition file
-a: alias for scratch org, don;t need to use long usernames each time.
-u : target username
Scratch org definition file -
A developer can select any edition,features, preferences of her choice. These configurations are stored in json format in definition file. These configurations can be shared across developers to get consistent scratch org created for every developer.
Let's start with default case, professional edition scratch org with default setting. You can create developer edition, enterprise and group editions.
We haven't yet added any features or settings.
{
"orgName": "Sample Org",
"edition": "professional"
}
Features -
Features are additional add-on functionality which can be supported by your edition. These are the functionalities that are not included by default in edition.These are the add-on licences with your edition. Some features require combination of feature and setting to work correctly.
{
"orgName": "Sample Org",
"edition": "professional",
"features": [
"PersonAccounts",
"custompps"
]
}
Settings -
With settings you can programmatically enable or disable settings of org. When these settings are enabled additional functionality is made available in setup UI. It is better to able to toggle these settings programmatically to support continuous integartion and automated development.
{
"orgName": "Sample Org",
"edition": "professional",
"features": [
"PersonAccounts",
"customApps"
],
"settings": {
"liveAgentSettings": {
"enableLiveAgent": true
}
}
}
OrgPreferences -
OrgPreferences are settings that a user can configure in org. e.g S1DesktopEnabled is for lightning enabled org. These settings are enabled (or disabled) in the orgPreferences section of the configuration file, in JSON format.
"settings": {
"orgPreferenceSettings": {
"s1DesktopEnabled": true
},
"liveAgentSettings": {
"enableLiveAgent": true
}
}
There is long list of features and settings that can be enabled in your scratch org,
For detailed list click here
No comments:
Post a Comment