Salesforce DX
abdelhakim.mouttaqui@gmail.com
@adbelhakim
https://www.linkedin.com/in/abdelhakimmouttaqui/
Abdelhakim Mouttaqui
Technical Architect & Force.com Developer
Casablanca – Oct 11th 2017
Goals and Audience
Discovering a brand new Salesforce Developer eXperience
Taking a simple use case’s walk-through steps
 Laying foundations for future more detailed DX events
Needed an intermediate sfdc experience
Events  Platform Basics talk
[What] sfdx
A new way to manage and develop apps across their entire lifecycle
 Source-driven development of code
 Team collaboration with governance
 Externalizing metadata
 Letting developers use their modern tools
 The “source of truth” shifts into a VCS
 New experiences, including the use of Heroku Flow to drive both CI and CD
[Why] sfdx
Solving developer sandbox quick/light rollback for canceled task
 Lightening developer sandbox setting up time loss
Simulating and testing apps on orgs with different features (compared with the “classic” dev
sandbox)
 Creating use-specific orgs for demo purposes
[Why] sfdx
CI scenarios : automated testing (e.g. with Jenkins) and optional further deploy to another
sandbox
[How] sfdx
Repository
creation
Local
Development
Pushing to
Scratch org
Optional
pulling
Pushing to a
sandbox or
testing env
Pushing to
remote
repository
Destroying
scratch org
Tools - prerequisites
Node JS
 Git
 Heroku/SFDX CLI
Tools: CLI – Commands Overview
sfdx force --help
sfdx force:project:create --projectname milanosfdug
sfdx force:mdapi:retrieve --unpackaged ./milanodug/package.xml --retrievetargetdir
./milanodug/retrieved
Use case - Big Picture
Retrieving Converting Developing Loading/Modeling Pushing
sfdx force:mdapi:retrieve
sfdx force:mdapi:convert
Retrieving and Converting
>> Setting up a package.xml file
>> Setting up a target folders for retrieved metadata
>> Taking action by CLI
sfdx force:auth:web:login
sfdx force:org:create
sfdx force:org:create
sfdx force:config:list
sfdx force:alias:set
Authorizing, creating a scratch org, config and alias settings
>> Authorizing our devhub (or another org, e.g. for using force:mdapi
 scratch orgs not manageable)
>> Check configs
>> Creating a new scratch org ( + defaultusername and scratch-
def.json)
>> Showing scratch orgs on Env Hub
>> Re-Check configs
>> Aliases : list, set and how to use them
sfdx force:source:status
sfdx force:source:push
Checking status and first push
>> Checking source status
>> Perfoming the first push
sfdx force:data:bulk:upsert
sfdx force:data:soql:query
sfdx
force:schema:sobject:describe
Developing, Loading, Querying
>> Editing metadata locally
>> Loading records from csv
>> Querying data
sfdx force:source:pull --force
sfdx force:source:push –-
force
git commit
git push
Push/Pull, conflicts, remote pushing
>> Pushing local edited files
>> Pulling remote changes
>> Solving conflict
>> Pushing to a remote repository
>> Destroying the scratch org
Demo
Thank Y u

Sfdx introduction