Visual Studio Code: How to Setup Visual Studio Code for Salesforce Development
In the recent past we have
observed that Visual Studio Code (VS Code) is picking up popularity among open
source IDEs for code development across multiple programming languages.
JavaScript based frameworks, Python based application development, Salesforce
Apex Code development, HTML, CSS based Front End development and so on are the
most popular choices working with VS Code. This powerful behavior of supporting
multiple platforms resides in the ability to adopt Plugins & Extension
Packs that supports most popular programming languages & frameworks, and I
believe VS Code has does a brilliant job so far.
In this article we will look into
detailed steps to setup Visual Studio Code as IDE for Salesforce code
development. Here are the quick list of the components that we would working
with in the steps below-
- Install & Configure Visual Studio Code
- Install & Configure Salesforce CLI
- Install & Configure Salesforce Extension Pack
- Create Test Salesforce Project
- Authorize Salesforce Org
We will discuss the individual
configuration for each of the moving parts contributing to this setup in the upcoming
steps-
Install & Configure Visual Studio Code
- We can download the latest VS Code Setup from the following Url: https://code.visualstudio.com
- Click on “Download for Windows”
- Save the setup file
- Open the setup file by right click > Open. Please make sure you don’t use “Run as Administrator” option since VS Code cannot be installed with Admin privileges as suggested by following alert message.
- Accept the License Terms and Click Next
- Click Next
- Click Next
- Make sure “Add To Path” is checked and Click Next
- Click Install
Wait till the setup completes the
installation, which should be really a quick install
- Click Finish & Launch VS Code to make sure installation works just fine
Install & Configure Salesforce CLI
- You can download the Salesforce CLI from the following Url: https://developer.salesforce.com/tools/sfdxcli
- Click “Download for Windows” depending on windows version you are running on
- Save the CLI setup file
- Open the setup file by right click > Open
- Keep the defaults and Click Next
- Keep the defaults and Click Install
Wait till setup completes the
installation, which should be really a quick install
- Click Close to complete the installation
Install & Configure Salesforce Extension Pack
- Launch VS Code
- On the left most menu panel, Click Extensions Icon of press “Ctrl + Shift + X”
- Search for “Salesforce Extension Pack”
- Install Salesforce Extension Pack by clicking “Install” and wait till installation completes
- Launch a new terminal by going to Terminal Menu > New Terminal or press “Ctrl + Shift + `”
Now we have to validate the installation of
Salesforce CLI by typing “SFDX” in
the new terminal. If we get the following similar outcome then we can ensure a
successful installation.
Create Test Salesforce Project
- Launch VS Code
- Press “Ctrl + Shift + P” to see all available commands from all installed plugins & extensions
- Search for “SFDX: Create Project with Manifest” and select it
- Select project template as “Standard” or whatever suits you the best
- Enter the desired name of the Project, whatever suits you
- Select the folder location to save this project on the disk
And sure enough we will get our
new Salesforce project created with the manifest file
Authorize Salesforce Org
- Launch VS Code
- Press “Ctrl + Shift + P” to see all available commands from all installed plugins & extensions
- Search for “SFDX: Authorize an Org” and select it
- Select for “Org Url” Template, I will go by project default for this demo
- Enter the Org Alias to recognize you Org by alias, I have specified “SFOrg” as alias for this demo
This process with direct you to
the Salesforce Login Page, where you can specified the login credential for
your Org (no matter Prod or Sandbox). Enter your credentials
Once successfully login to the
Salesforce Org. visit the VS Code again and sure enough we get the
notifications to successfully authorize the Org.
Hope you enjoyed this article. Please leave your comments to let me know how you do like the content and how you do find it helpful to learn the topic.
Comments
Post a Comment