Deploying the code from source control

Now that we have our initial source control content for the application created, you could safely delete your source code from your local machine and re-download it at any time by selecting the Clone or Download button in the GitHub browser UI.

Let's imagine you have just done that! How do you go from having nothing in Salesforce to something you can start developing with? If you have been following along since Chapter 1, Building and Publishing Your Application, then you will have used the following commands already. The following is a reminder of them all together (enter them all as one line if you want to try them out):

sfdx force:org:create 
--definitionfile config/project-scratch-def.json --setalias dev
--durationdays 7 --setdefaultusername --json

sfdx force:source:push

sfdx force:user:permset:assign
--permsetname FormulaForceRaceManagement

sfdx force:data:tree:import --plan ./data/Data-plan.json

sfdx force:org:open

The preceding commands can get repetitive, so you may want to write a shell script or Batch File if you are using Windows to automate them for your developers. Typically, this is called setup.sh, or setup.bat for Windows.

Congratulations—you have now taken the first step in utilizing source control! This also means that you can now allow other developers to start working independently on your code base by following the same developer flow using their own developer orgs.

Salesforce does not automatically grant access to applications, tabs, pages, objects, and fields deployed using the sfdx force:source:push command. So, you will find that before you can see these components, you need to assign your Permission Sets to your developer org user. Doing this is a good way to ensure that these are kept up to date with new components and are valid.

In general, testing as a system administrator is not a reliable confirmation of your application working in an end user scenario. This is why Salesforce has adopted this policy, to make the developer think about which permissions need to be applied, even in a developer org.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.199.191