Sunday, September 8, 2019

How to set up a visual studio code for Salesforce?

In this blog post we are going to learn "How to set up visual studio code for Salesforce?".

Setting up the Salesforce DX Environment:

1) Download Visual code studio from https://code.visualstudio.com

2) After downloading open the Visual code studio you will see something like these.

Lightning Web Components

3) Click on the symbol shown in the below image.

Lightning Web Components

4) Type "Salesforce extension pack" in search box and click install as shown in below image.

how to set up visual studio code for salesforce

5) Now open google chrome and search for "install Salesforce cli" and open the link as shown in below image.

Lightning Web Components

6) Click download in the below image.

Salesforce CLI

7) To check if it is downloaded properly open Command Prompt and type sfdx and press enter.

Lightning Web Components

8) Now to install the latest plugin type "sfdx plugins:install salesforcedx@latest" and wait till the installation is completed.

9) Now we need to set the path and environment variable on our desktop.

Go to This PC > Right click on This PC > Properties > Advanced system settings > Environment variables > Double click on Path and check if the Path has the "C:\Program Files\Salesforce CLI\bin". Also the under the System variable check if the Path has "C:\Program Files\Salesforce CLI\bin". If this is missing under Path in "User variables for home" or "System variables" section create the same using the new button.

Lightning Web Components

10) Now to check if everything is setup properly go to Visual Studio and Press CTRL+SHIFT+P.
Enter SFDX: Create Project with Manifest > Enter the project name > Select the folder. It will create a Project for us after running as shown below.

If you get this error: Error: Salesforce CLI is not installed.

Just close the visual code studio and start again.

LWC

1 comment:

  1. Hi ... I am getting an error in Terminal Window - The terminal process terminated with exit code: 3221225781
    can you please help me

    ReplyDelete