Setup Visual Studio Code for Salesforce Development without Scratch Org

This is a step to step guide to setup Visual Studio Code for salesforce development without using Dev-Hub and Scratch Orgs, you can now use vs code for your Dev Org and Sandboxes just like any other IDE, also this will allow you to push your manifest at many org at once and even sync it with your Code Repository.

तो चलिए शुरू करते हैं (Let’s get started)

1. Install Salesforce CLI from this link https://developer.salesforce.com/tools/sfdxcli, if already installed make sure you have the latest version.

2. Download and Install Salesforce VsCode from here https://code.visualstudio.com/, if already installed make sure you have the latest version.

3. Install “Salesforce Extension Pack” from Extensions Marketplace in VS Code.
Setup Visual Studio Code for Salesforce Development without Scratch Org
4. In the Terminal window, run the following command,
sfdx plugins:install salesforcedx

Setup Visual Studio Code for Salesforce Development without Scratch Org

If the terminal is not visible on UI then go to Menu->View->Terminal

5. Create a Project

  • Press “CTRL+SHIFT+P” then select  “SFDX: Create Project with Manifest

VS Create Project with manfest

  • Then enter your Project Name and select a folder where you want to keep all your local copy of Manifest and ProjectFiles.

Enter project name

6. Authorize your Dev Org or Sandbox

  • Press “CTRL+SHIFT+P” then select  “SFDX: Authorize an Org

Authorize Dev Org

7. Select Org Type

Enter Org Type

After Successful login, you can close the browser and you can notice that few files and folder are now displayed in the left sidebar.

8. Retrieve Metadata

  • Now we will be retrieving all the necessary manifest to make changes, for that expand the manifest folder and open package.xml in the editor. (If you are working on fresh org you can skip this step)
  • Edit package XML to retrieve desired components from the authorized org.
  • After that right click on package.xml either in Explorer or in the Editor Window and click on SFDX: Retrieve Source in Manifest from Org

Retrieve Metadata

After the retrieval process is completed you can see your metadata in force-app folder in the explorer.

9. Deploy Metadata

  • After you are done with changes in your Metadata, just right click on that file and click on SFDX: Deploy This Source to Org, it will deploy your changes to Authorized org and remember that the source you deploy overwrites the corresponding metadata in your Org

Deploy Metadata

Good luck with the development in VS Code and say goodbye to other IDEs.

Some useful links:
1. Salesforce CLI Documentation

2. CLI Reference for Force Limits

Was this post useful? If yes then please share.



Comments (1)

  1. Nice post👍 Now you can also use Salesforce package.xml generator extension for vs code. This provides an UI to choose components for package.xml file just like Force.com IDE

    https://marketplace.visualstudio.com/items?itemName=VignaeshRamA.sfdx-package-xml-generator

Leave a Comment

All fields marked with an asterisk (*) are required


shares