Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Farmington Hills Salesforce Developer User
Group
Salesforce Apex Hours :-Salesforce DX
#SalesforceApexHours #FarmingtonHil...
Who am I ?
Amit Chaudhary
• Active on Salesforce Developer Community
• Blogging at http://amitsalesforce.blogspot.in/
• Co...
Our Speaker
Jitendra Zaa
Salesforce MVP
Agenda
▶ Introduction to Salesforce DX
▶ Creating Scratch Org
▶ Deploying metadata to Scratch Org
▶ Creating Skeleton Work...
What is Salesforce Dx
▶ New tool to manage deployment life cycle
▶ SCM driven
▶ Package based development
▶ Scratch Org
▶ ...
How to get Salesforce Dx
▶ Its in Pilot
▶ Will go to Beta and then GA after Pilot
▶ Your Org may already have access
▶ Wai...
Installation
▶ Install Salesforce CLI from here - https://developer.salesforce.com/media/salesforce-
cli/sfdx-windows-amd6...
Salesforce DX CLI
Developer Hub Org
▶ The Developer Hub org is used to authorize all Salesforce DX users. The Developer Hub
(Dev Hub) org is...
Clone - https://github.com/forcedotcom/sfdx-simple
Run all commands in sfdx-simple folder
Authorize your hub org using bel...
To Create a scratch Org, we need to have following json
{
"Company": "Cognizant",
"Country": "US",
"LastName": "Zaa",
"Ema...
▶ Run below command to create scratch org
sfdx force:org:create --setdefaultusername -f config/workspace-scratch-
def.json...
To open scratch Org, run below command
sfdx force:org:open
Open Scratch Org
This JSON contains information about Salesforce Dx project
{
"PackageDirectories": [
{
"Path": "force-app"
}
],
"Namespace...
As per “sfdx-workspace.json” in previous slide, below command will take metadata from
force-app folder and move to scratch...
▶ Below command will create skeleton of DX project workspace with json and folder
structures
sfdx force:workspace:create -...
sfdx force:apex:test:run
Above command will return Job Id, use that Job Id to get report of test result
sfdx force:apex:te...
▶ Run below command to get the list of all Scratch Org that has been authorized by SFDX
sfdx force:org:list
List all Scrat...
Running below command shows all Top level topics
Sfdx --help
We can get help for each topic by using --help again at topic...
▶ SalesforceDx logs are saved at
USER_HOME_DIR/.sfdx/sfdx.log
▶ Its running log, and only errors are logged by default
▶ L...
Available Log levels in Salesforce Dx
1. ERROR
2. WARN
3. INFO
4. DEBUG
5. TRACE
▶ Salesforce DX creates scratch Org and stores Oauth token internally, It does not provides
password. We can generate pass...
Force.com IDE
Create Workspace
▶ Navigate to File | New | Workspace
Getting Help and list of available command in Force.com IDE
Resources
▶ Wade Wegner (VP Product for Salesforce DX)
▶ Getting started with Salesforce DX (Jitendra Zaa)
Thank You
Thank you for attending the session.
Follow Farmington Hills SFDC Developer Group
Twitter Hashtag
#FarmingtonHillsSFDCDug
Meetup.com
https://www.meetup.com/Far...
Upcoming SlideShare
Loading in …5
×

Salesforce Apex Hours:- Salesforce DX

961 views

Published on

Hello Everyone !

"Salesforce Apex Hours" is a recurring event to talk about salesforce ! Some times we'd like to meet on one location and some time online.

This time we are planning one online session on "Salesforce DX" with Jitendra Zaa (Salesforce MVP).

Agenda :-
Salesforce DX provides you with an integrated, end-to-end lifecycle designed for high-performance agile development. In this session we would go through hands on and see how Salesforce DX can be used to create scratch org, automated testing and data load purpose. We would discuss CLI option as well Force.com IDE

• Introduction to Salesforce DX
• Creating Scratch Org
• Deploying metadata to Scratch Org
• Creating Skeleton Workspace
• Running Test classes
• Getting Help
• Using Force.com IDE with Salesforce DX
• Q&A

Published in: Education

Salesforce Apex Hours:- Salesforce DX

  1. 1. Farmington Hills Salesforce Developer User Group Salesforce Apex Hours :-Salesforce DX #SalesforceApexHours #FarmingtonHillsSFDCDug Speaker :- Jitendra Zaa (Salesforce MVP), Amit Chaudhary Date :- Saturday, JUNE 10, 2017 11:00 AM EST Venue/Link :- Online
  2. 2. Who am I ? Amit Chaudhary • Active on Salesforce Developer Community • Blogging at http://amitsalesforce.blogspot.in/ • Co-Organizer of :- FarmingtonHillsSFDCDug
  3. 3. Our Speaker Jitendra Zaa Salesforce MVP
  4. 4. Agenda ▶ Introduction to Salesforce DX ▶ Creating Scratch Org ▶ Deploying metadata to Scratch Org ▶ Creating Skeleton Workspace ▶ Running Test classes ▶ Getting Help ▶ Using Force.com IDE with Salesforce DX ▶ Q&A
  5. 5. What is Salesforce Dx ▶ New tool to manage deployment life cycle ▶ SCM driven ▶ Package based development ▶ Scratch Org ▶ CLI & Force.com support
  6. 6. How to get Salesforce Dx ▶ Its in Pilot ▶ Will go to Beta and then GA after Pilot ▶ Your Org may already have access ▶ Wait for Beta or GA
  7. 7. Installation ▶ Install Salesforce CLI from here - https://developer.salesforce.com/media/salesforce- cli/sfdx-windows-amd64.exe Get Force.com IDE https://developer.salesforce.com/media/force-ide/sfdx/pilot/force-ide-Pilot- win32.win32.x86_64.zip
  8. 8. Salesforce DX CLI
  9. 9. Developer Hub Org ▶ The Developer Hub org is used to authorize all Salesforce DX users. The Developer Hub (Dev Hub) org is a central location for Salesforce DX because it allows you to create, delete, and manage your Salesforce scratch orgs.
  10. 10. Clone - https://github.com/forcedotcom/sfdx-simple Run all commands in sfdx-simple folder Authorize your hub org using below command sfdx force:auth:web:login --setdefaultdevhubusername --setalias my-devhub- org Above command will open browser and we would need to enter username and password of developer hub account Authorize Developer Hub Org
  11. 11. To Create a scratch Org, we need to have following json { "Company": "Cognizant", "Country": "US", "LastName": "Zaa", "Email": "jitendra.Zaa@cognizant.com", "Edition": "Developer", "OrgPreferences" : { "S1DesktopEnabled" : true } } All supported org preferences can be found in Metadata Settings documentation. Creating Scratch Org
  12. 12. ▶ Run below command to create scratch org sfdx force:org:create --setdefaultusername -f config/workspace-scratch- def.json --setalias jitendra1_scratch Creating Scratch Org (Contd)
  13. 13. To open scratch Org, run below command sfdx force:org:open Open Scratch Org
  14. 14. This JSON contains information about Salesforce Dx project { "PackageDirectories": [ { "Path": "force-app" } ], "Namespace": "", "SourceApiVersion": "39.0" } Push Metadata to scratch Org (sfdx-workspace.json)
  15. 15. As per “sfdx-workspace.json” in previous slide, below command will take metadata from force-app folder and move to scratch org. On successful completion, it will show below message sfdx force:source:push Moving changes to Scratch Org
  16. 16. ▶ Below command will create skeleton of DX project workspace with json and folder structures sfdx force:workspace:create --workspacename mywork OR sfdx force:workspace:create --workspacename mywork --defaultpackagedir myapp Create Salesforce DX workspace from CLI
  17. 17. sfdx force:apex:test:run Above command will return Job Id, use that Job Id to get report of test result sfdx force:apex:test:report -i <ID> Run Apex test from CLI
  18. 18. ▶ Run below command to get the list of all Scratch Org that has been authorized by SFDX sfdx force:org:list List all Scratch Org
  19. 19. Running below command shows all Top level topics Sfdx --help We can get help for each topic by using --help again at topic level like Sfdx force --help We can further get help of subtopic using command –help Sfdx force:alias --help Getting Help
  20. 20. ▶ SalesforceDx logs are saved at USER_HOME_DIR/.sfdx/sfdx.log ▶ Its running log, and only errors are logged by default ▶ Logs can be changed either with each command or globally ▶ To change at each command, use --loglevel DEBUG ▶ To set log level globally use set SFDX_LOG_LEVEL=DEBUG (windows) Or Export SFDX_LOG_LEVEL=DEBUG (Unix) SalesforceDx logs
  21. 21. Available Log levels in Salesforce Dx 1. ERROR 2. WARN 3. INFO 4. DEBUG 5. TRACE
  22. 22. ▶ Salesforce DX creates scratch Org and stores Oauth token internally, It does not provides password. We can generate password by running below command sfdx force:user:password:generate ▶ To see generated password again in future , use below command sfdx force:org:describe Generating Password of Scratch Org
  23. 23. Force.com IDE
  24. 24. Create Workspace ▶ Navigate to File | New | Workspace
  25. 25. Getting Help and list of available command in Force.com IDE
  26. 26. Resources ▶ Wade Wegner (VP Product for Salesforce DX) ▶ Getting started with Salesforce DX (Jitendra Zaa)
  27. 27. Thank You Thank you for attending the session.
  28. 28. Follow Farmington Hills SFDC Developer Group Twitter Hashtag #FarmingtonHillsSFDCDug Meetup.com https://www.meetup.com/Farmington-Hills-Salesforce-Developer- Meetup/ Facebook Page https://www.facebook.com/FarmingtonHillsSfdcdug/?ref=bookmarks

×