Tuesday, February 19, 2019

Salesforce DX(SFDX) setup for non scratch org(Developer/Sandbox)

This post explains how to set up Salesforce DX(SFDX) for non-scratch org(Developer/Sandbox)

Step 1: install salesforce CLI and VS Code

1. Download and Install Salesforce CLI
2. Download vs code From this link and install.

Note: Once installed the Salesforce CLI you can verify using below command
sfdx --version
3. Install salesforcedx plugin using below command
sfdx plugins:install salesforcedx

Verify installed plugins using below command
sfdx plugins

Installing Salesforce Extensions in vs code
1. Open vs code install Salesforce extension pack

Step 2: Create a Project

Once complete the Step1, open the command palette
To open the command palette, press Cmd+Shift+P (macOS) or Ctrl+Shift+P (Windows or Linux).


Enter project Name and Select Folder
Once create the Project, configure the below files
1. sfdx-project.json
2. package.xml
sfdx-project.json
 if you are connecting to sandbox change the sfdcloginurl to test.salesforce.com
check below screenshot

package.xml
go to manifest folder ---> package.xml
add the components which data you want to retrieve in the package.xml
check below screenshot

Step 3: Authorize an Org

once complete the step2, open command palette then select SFDX: Authorize an Org

this command opens your default browser then login to your developer/sandbox org
once logged in to your org you may close your browser.

Step 4: Retrieve the source from org

once complete the step3, go to your package.xml, right click on the package.xml
select retrieve source in manifest from Org.
check screenshot
this command retrieves the source from your org, it is taken some time based on data in your Org.

Step 5: Deploy or retrieve the code from the server

Once you retrieve the source form your org, to open any file in the project folder press ctrl+p
it opens search palette.
check screenshot

if you want to save the code into your org, right click on that file, select SFDX: Deploy to org
if you want to refresh the file from server select SFDX: Retrieve the source from org
check below screenshot

That's it.
Let us know if you have any queries.

No comments:

Post a Comment