Farmington Hills
Salesforce Developer User Group
Apex Hours
SalesforceDX For Non-Scratch Orgs
#SalesforceApexHours #FarmingtonHillsSFDCDug
Speaker
Date
Venue/Link
Mohith Shrivastava, Prajakta Samant
Saturday, NOV 3, 2018 10:00 AM EST ( 7:00 PM IST)
https://zoom.us/j/972158462
#FarmingtonHillsSFDCdug #SalesforceApexHours
Apex Hours
Prajakta Samant
@WWCodePune Director
#Salesforce PUG Leader
Solution Architect – Eternus Solutions
#SalesforceApexHours #FarmingtonHillsSFDCDug
Who am I ?
Our Speaker
Mohith Shrivastava
Salesforce MVP
Author “Learning Salesforce Lightning Application
Development ”
Technical Architect – CodeScience INC
#SalesforceApexHours #FarmingtonHillsSFDCDug
 Scratch Org Source Driven Development VS Change Set Development
 SalesforceDX source code format differences from traditional format
 Winter 19 Salesforce Source Commands (Retrieve, Deploy and Delete)
 Using Salesforce Extensions For VSCode against Non-scratch orgs
 Auto Generating package.xml from changesets and unmanaged package
 Setting Developer Workflows for Salesforce application development and debugging
(ISV apps and changeset based development)
 Deploying metadata from one org to another using Vscode extensions
AGENDA
#SalesforceApexHours #FarmingtonHillsSFDCDug
Apex Hours
#FarmingtonHillsSFDCdug #SalesforceApexHours
Scratch Org Based Development
Credits - @Trailhead
Apex Hours
#FarmingtonHillsSFDCdug #SalesforceApexHours
Change Set Based Development
Credits - @Trailhead
Apex Hours
#FarmingtonHillsSFDCdug #SalesforceApexHours
SalesforceDX source code format
differences from traditional format
Object metadata is further organized into below sub directories
businessProcesses
compactLayouts
fields
fieldSets
listViews
recordTypes
sharingReasons
validationRules
webLinks
Apex Hours
#FarmingtonHillsSFDCdug #SalesforceApexHours
SalesforceDX source code format
differences from traditional
format…
Translations in separate directory
<directory>/main/default/objectTranslations
Static Resources are uncompressed in DX so one can edit it
Lightning bundles and components must reside in a directory
named aura under the <package directory> directory.
Documents organized inside its folder directory
Apex Hours
#FarmingtonHillsSFDCdug #SalesforceApexHours
Scratch Org VS Sandbox Change Set
Based Development
Scratch Org Development Approach Change Set Based Development
Encourages Complete Source Driven Development .Scratch org are designed
to track changes between local and the scratch org .
Suitable for change set based development model
Suitable if your application has less no of post install configuration(Subject
to change in future with org shapes and Templates)
If your application has lots of post install config and
depends on lot of other applications (example apps on
top of Health cloud, Financial Cloud , Salesforce CPQ
etc) sandbox has lots of advantages
Highly Recommended for ISVs building managed package application or
System Integrators building Unlocked Packages
Apps that have not moved to SalesforceDX source
format can benefit from this approach
Apex Hours
#FarmingtonHillsSFDCdug #SalesforceApexHours
Winter 19 Salesforce Source Commands
(Retrieve, Deploy and Delete)
Currently these commands are in BETA and hence you are of your own till
these become GA .
Retrieve Commands
$ sfdx force:source:retrieve -x path/to/package.xml
$ sfdx force:source:retrieve -m CustomObject,ApexClass
Deploy Commands
$ sfdx force:source:deploy -x path/to/package.xml
$ sfdx force:source:deploy -m ApexClass:MyApexClass
Apex Hours
#FarmingtonHillsSFDCdug #SalesforceApexHours
Using Salesforce Extensions For
VSCode against Non-scratch orgs
Install SalesforceDX CLI
Install VSCode
Install Salesforce Extensions for VSCode
Apex Hours
#FarmingtonHillsSFDCdug #SalesforceApexHours
AutoGenerate package.xml Script
Get the shell script from here
Create scripts folder in root folder and create the shell script file
generatepkgXML.sh
Provide permissions to the shell script folder using chmod +x
/scripts/generatepkgXML.sh
Run the command ./scripts/generatepkgXML.sh <orgalias>
<changeset/unmanaged package name>
Apex Hours
#FarmingtonHillsSFDCdug #SalesforceApexHours
Developer Workflow Demo
Apex Hours
#FarmingtonHillsSFDCdug #SalesforceApexHours
Deployment Demo
Apex Hours
#FarmingtonHillsSFDCdug #SalesforceApexHours
Debugging Apex
Apex Hours
#FarmingtonHillsSFDCdug #SalesforceApexHours
Reference Resources
https://www.youtube.com/watch?v=lQ-ZpCRKYM0
https://www.youtube.com/watch?v=JivDTfYvZ50
https://www.youtube.com/watch?v=uTHWRL9uU08
Blogposts
https://developer.salesforce.com/blogs/2018/10/vs-code-for-salesforce-
developers-your-questions-answered.html
Apex Hours
#FarmingtonHillsSFDCdug #SalesforceApexHours
Follow Farmington Hills SFDC Developer Group
Twitter Hashtag
#FarmingtonHillsSFDCDug #SalesforceApexHours
Meetup.com
https://trailblazercommunitygroups.com/farmington-mi-
developers-group/
YouTube

Salesforce DX for Non-Scratch Org

  • 1.
    Farmington Hills Salesforce DeveloperUser Group Apex Hours SalesforceDX For Non-Scratch Orgs #SalesforceApexHours #FarmingtonHillsSFDCDug Speaker Date Venue/Link Mohith Shrivastava, Prajakta Samant Saturday, NOV 3, 2018 10:00 AM EST ( 7:00 PM IST) https://zoom.us/j/972158462
  • 2.
    #FarmingtonHillsSFDCdug #SalesforceApexHours Apex Hours PrajaktaSamant @WWCodePune Director #Salesforce PUG Leader Solution Architect – Eternus Solutions #SalesforceApexHours #FarmingtonHillsSFDCDug Who am I ?
  • 3.
    Our Speaker Mohith Shrivastava SalesforceMVP Author “Learning Salesforce Lightning Application Development ” Technical Architect – CodeScience INC #SalesforceApexHours #FarmingtonHillsSFDCDug
  • 4.
     Scratch OrgSource Driven Development VS Change Set Development  SalesforceDX source code format differences from traditional format  Winter 19 Salesforce Source Commands (Retrieve, Deploy and Delete)  Using Salesforce Extensions For VSCode against Non-scratch orgs  Auto Generating package.xml from changesets and unmanaged package  Setting Developer Workflows for Salesforce application development and debugging (ISV apps and changeset based development)  Deploying metadata from one org to another using Vscode extensions AGENDA #SalesforceApexHours #FarmingtonHillsSFDCDug
  • 5.
    Apex Hours #FarmingtonHillsSFDCdug #SalesforceApexHours ScratchOrg Based Development Credits - @Trailhead
  • 6.
    Apex Hours #FarmingtonHillsSFDCdug #SalesforceApexHours ChangeSet Based Development Credits - @Trailhead
  • 7.
    Apex Hours #FarmingtonHillsSFDCdug #SalesforceApexHours SalesforceDXsource code format differences from traditional format Object metadata is further organized into below sub directories businessProcesses compactLayouts fields fieldSets listViews recordTypes sharingReasons validationRules webLinks
  • 8.
    Apex Hours #FarmingtonHillsSFDCdug #SalesforceApexHours SalesforceDXsource code format differences from traditional format… Translations in separate directory <directory>/main/default/objectTranslations Static Resources are uncompressed in DX so one can edit it Lightning bundles and components must reside in a directory named aura under the <package directory> directory. Documents organized inside its folder directory
  • 9.
    Apex Hours #FarmingtonHillsSFDCdug #SalesforceApexHours ScratchOrg VS Sandbox Change Set Based Development Scratch Org Development Approach Change Set Based Development Encourages Complete Source Driven Development .Scratch org are designed to track changes between local and the scratch org . Suitable for change set based development model Suitable if your application has less no of post install configuration(Subject to change in future with org shapes and Templates) If your application has lots of post install config and depends on lot of other applications (example apps on top of Health cloud, Financial Cloud , Salesforce CPQ etc) sandbox has lots of advantages Highly Recommended for ISVs building managed package application or System Integrators building Unlocked Packages Apps that have not moved to SalesforceDX source format can benefit from this approach
  • 10.
    Apex Hours #FarmingtonHillsSFDCdug #SalesforceApexHours Winter19 Salesforce Source Commands (Retrieve, Deploy and Delete) Currently these commands are in BETA and hence you are of your own till these become GA . Retrieve Commands $ sfdx force:source:retrieve -x path/to/package.xml $ sfdx force:source:retrieve -m CustomObject,ApexClass Deploy Commands $ sfdx force:source:deploy -x path/to/package.xml $ sfdx force:source:deploy -m ApexClass:MyApexClass
  • 11.
    Apex Hours #FarmingtonHillsSFDCdug #SalesforceApexHours UsingSalesforce Extensions For VSCode against Non-scratch orgs Install SalesforceDX CLI Install VSCode Install Salesforce Extensions for VSCode
  • 12.
    Apex Hours #FarmingtonHillsSFDCdug #SalesforceApexHours AutoGeneratepackage.xml Script Get the shell script from here Create scripts folder in root folder and create the shell script file generatepkgXML.sh Provide permissions to the shell script folder using chmod +x /scripts/generatepkgXML.sh Run the command ./scripts/generatepkgXML.sh <orgalias> <changeset/unmanaged package name>
  • 13.
  • 14.
  • 15.
  • 16.
    Apex Hours #FarmingtonHillsSFDCdug #SalesforceApexHours ReferenceResources https://www.youtube.com/watch?v=lQ-ZpCRKYM0 https://www.youtube.com/watch?v=JivDTfYvZ50 https://www.youtube.com/watch?v=uTHWRL9uU08 Blogposts https://developer.salesforce.com/blogs/2018/10/vs-code-for-salesforce- developers-your-questions-answered.html
  • 17.
    Apex Hours #FarmingtonHillsSFDCdug #SalesforceApexHours FollowFarmington Hills SFDC Developer Group Twitter Hashtag #FarmingtonHillsSFDCDug #SalesforceApexHours Meetup.com https://trailblazercommunitygroups.com/farmington-mi- developers-group/ YouTube