Skip to content

Instantly share code, notes, and snippets.

@hugohernandezfcc
Last active May 6, 2020 06:34
Show Gist options
  • Save hugohernandezfcc/a8c6e765357ac2ca4be5c5907c0ab765 to your computer and use it in GitHub Desktop.
Save hugohernandezfcc/a8c6e765357ac2ca4be5c5907c0ab765 to your computer and use it in GitHub Desktop.
How create a project and make deploy changes, even run test methods from terminal.
###################################################################
######## Project ready to work with any IDE ########
###################################################################
# Create a SFDX project from terminal
sfdx force:project:create --projectname myproject --manifest
# Position yourself on the project folder
cd myprojectname
# Set an alias and login on your developer Org
sfdx force:auth:web:login --setalias userOrgNewFeatures --setdefaultusername
# Get all the metadata that was created on your org previously.
sfdx force:source:retrieve --manifest manifest/package.xml
#####################################################################################
######## Make a deploy from terminal with too many files or a specific file ########
#####################################################################################
sfdx force:source:deploy --loglevel fatal --sourcepath force-app/main/default/METADATAFOLDER/
OR
sfdx force:source:deploy --loglevel fatal --sourcepath force-app/main/default/METADATAFOLDER/FILE.APEX
#####################################################################################
######## Run test methods from terminal and select too many controllers ########
#####################################################################################
sfdx force:apex:test:run --classnames TestA,TestB --resultformat tap --codecoverage
@hugohernandezfcc
Copy link
Author

If you need run sfdx force:auth:web:login but on sandbox enviroment just add --instanceurl https://test.salesforce.com as parameter on the same command line.

@hugohernandezfcc
Copy link
Author

hugohernandezfcc commented Mar 28, 2019

To create a class sfdx force:apex:class:create -n NameController -d force-app/main/default/classes

@hugohernandezfcc
Copy link
Author

sfdx force:apex:execute -u MyConnectedOrg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment