Salesforce DX environment setup.

Before creating the Lightning Web Component, we need to set up the salesforce DX project. In the previous article, we already have covered the prerequisite for creating the DX project.

Steps to setup Salesforce DX project

  1. In VS Code, open the Command Palette by pressing Ctrl+Shift+P on Windows or Cmd+Shift+P on macOS.
  2. Type SFDX and Select SFDX: Create Project.

fig: Salesforce VS code project creation
fig: Salesforce VS code project creation

  1. Type HelloWorld as the project name and press Enter.

fig: Entering DX project Name
fig: Entering DX project Name

  1. Select a folder to store the project.
  2. Click Create Project. You will see something like this as your base setup.

fig: Salesforce DX folder structure
fig: Salesforce DX folder structure

Authorize Your org

Till now, we have set up the DX project for our machine now. We have to connect this with our salesforce org. Follow the following steps to authorize your org

  1. In VS Code, open the Command Palette by pressing Ctrl+Shift+P on Windows or Cmd+Shift+P on macOS.
  2. Type SFDX and Select SFDX: Authorize an Org.

fig: Salesforce DX Authorize to an org
fig: Salesforce DX Authorize to an org

  1. Press Enter to accept the Project Default Use login URL option.
  2. Press Enter to accept the default alias. It will open a window to Log in using your Salesforce credentials.

fig: Authorize login
fig: Authorize login

  1. After you authenticate in the browser, the CLI remembers your credentials. The success message should look like this:

fig: Success authorization message
fig: Success authorization message

Site developed by Nikhil Karkra © 2021 | Icons made by Freepik