- These instructions demonstrate how to copy an Existing app from a package
- Second part are instructions on how to convert a source to a package and deploy to an org.
- Create project
sfdx force:project:create -n sfdx-MutualFundExplorer
cd sfdx-MutualFundExplorer
-
Do GIT stuff (e.g. git init, create repo, add .gitignore)
-
Create a scratch org
sfdx force:org:create -f config/project-scratch-def.json -a TempUnmanaged
- View config data for the scratch org
sfdx force:org:display -u TempUnmanaged
- Create password
sfdx force:user:password:generate -u TempUnmanaged
- View the config data again
sfdx force:org:display -u TempUnmanaged
- Install the Unmanaged Package as instructed in:
https://trailhead.salesforce.com/trails/sfdx_get_started/modules/sfdx_app_dev/units/sfdx_app_dev_deploy
- Create the Permission Set as instructed in:
https://trailhead.salesforce.com/trails/sfdx_get_started/modules/sfdx_app_dev/units/sfdx_app_dev_deploy
- Extract permission sets from scratch org
sfdx force:source:pull -u TempUnmanaged
- Create a folder called
mdapipackage
mkdir mdapipackage
- Retrieve the contents of the DreamInvest package into the mdapipackage folder:
sfdx force:mdapi:retrieve -s -r ./mdapipackage -p DreamInvest -u TempUnmanaged -w 10
- Change to the mdapipackage folder and verify that the unpackaged.zip file appears.
cd mdapipackage
- Unzip
unpackaged.zip
unzip unpackaged.zip -d .
- Delete
unpackaged.zip
rm unpackaged.zip
- From the MutualFundExplorer folder, convert the contents of the mdapipackage folder
cd ..
sfdx force:mdapi:convert -r mdapipackage/
- Delete
mdapipackage
rm -rf mdapipackage
- Delete scratch org
sfdx force:org:delete -u TempUnmanaged
- Create new scratch org
sfdx force:org:create -s -f config/project-scratch-def.json
- Push source and metadata to scratch org
sfdx force:source:push
- Assign permission set
sfdx force:user:permset:assign -n DreamInvest
Register Your Testing Environment
- Most of the time you’ll use a sandbox for testing, but for purposes of this module, go ahead and use your Trailhead Playground org for this step.
- Log in to your Trailhead Playground org and create an alias for it.
sfdx force:auth:web:login -a MyTPO
- Confirm that this org is available:
sfdx force:org:list
- Convert the source back to a format you can use with Metadata API.
- Create mdapioutput
mkdir mdapioutput
- Convert
sfdx force:source:convert -d mdapioutput/
- Deploy
sfdx force:mdapi:deploy -d mdapioutput/ -u MyTPO -w 100
- Assign permission set
sfdx force:user:permset:assign -n DreamInvest -u MyTPO
- Run your tests and interact with the app:
sfdx force:org:open -u MyTPO