How To Configure Visual Studio Code For Salesforce

Step By Step Configuration Guide:-


Step 1:-Install latest version of visual studio from the link given Visual Studio Code and Launch VS Code

Step 2:-To install extensions --Red mark shows the extension from where you have to install following extension




Step 3:- Create Project :-Press Ctrl+Shift+P and "Create project with Manifest".




It will ask to "Enter Project Name" then  press enter and will redirect to project location where you want to create the project.




The Manifest File generated from extension Salesforce Package.xml Generator Extension for VS Code ,which will used to retrieve,deploy,delete  and create any Metadata  in VS Code Editor / deploy to Salesforce Org.



Step 4:-Authentication of your Organisation :- Salesforce org. Authorisation by providing username and password via "Salesforce CLI (Command Line Interface) Integration" Extension.This extension is part of Salesforce Extension Pack  so no need to install again.

Now you have to press Ctrl+ Shift +P  and search "SFDX: Authorize an Org" . After  pressing enter salesforce authentication page will be open in default browser.

Authorize SFDC Org. 

Choose Your Environment
After Choosing Org it will ask for "Alias Name". and open the SFDC Login page for Authorization.

Step 5 :- Choose Metadata Component and Update Package.xml File  In "Step 3"if you want to Update your manifest file then press  Ctrl+ Shift +P and search "SFDX: Package.xml Generator: Choose Metadata Component" and Choose metadata component you want to retrieve in your Created Project.

Select Package.xml Generator

In my case i choosen Only Two Metadata (Apex class and Apex Trigger)


Updated Package.xml (in Manifest File)
Step 6:- Retrieve Metadata Components:--In Previous "Step" i only Chosen two metadata i.e. Apex Class And Apex Trigger. so whenever i will select "SFDX: Retrieve  Source in manifest From Org" it will try to Retrieve Only those metadata Components that was mentioned in Package.xml File.

Retrieve Metadata Component
Right Click On Package.xml "SFDX: Retrieve  Source in manifest From Org" option will appear,onclick it will start retrieving all the metadata components.

After that Closing  and Opening  the Editor See Apex Class And Apex Trigger in "force-App" Section. All the Classes And Triggers  will  available in Apex Class And Apex Trigger Metadata respectively.

Apex Triggers Retrieved
Step 7:- Deploy Individual Class Changes To Org. you  can Retrieve and deploy individual Classes  to Salesforce Org.

Retrieve And Deploy Changes To / And From Org

Step 8:- Now you can start you coding with Visual Studio Code Editor.

Comments