Create a Salesforce DX Project in Visual Studio Code

Create a Salesforce DX Project

Open Visual Studio Code editor --> open the Command Palette by pressing Ctrl+Shift+P --> then type SFDX: Create Project with Manifest press Enter -->then Enter the Project Name press Enter --> then Select the Folder to Store project files. Then client on Create. It will take some time to create a project structure.
VS-Code-Project

Authorize Your Developer org

Open the Command Palette by pressing Ctrl+Shift+P --> then type SFDX: Authorize an Org press Enter -->then accept the Project Default login URL option --> Then it will open a browser to login with your developer org credentials. That's it.

Create a First Lightning Web Component

Create Hello World Lightning web component

  1. Open the Command Palette by pressing Ctrl+Shift+P, then type SFDX: Create Lightning Web Component press enter.
  2. Enter helloWorld for the name of the new component then press enter to create.
then it will create 3 files like below screen.

sfdx-component-structure

3. In the HTML file, helloWorld.html, copy and paste the following code.
[<template>
    <lightning-card title="HelloWorld" icon-name="custom:custom14">
        <div class="slds-m-around_medium">
            <p>Hello, {greeting}!</p>
            <lightning-input label="Name" value={greeting} onchange={changeHandler}></lightning-input>
        </div>
    </lightning-card>
</template>]

4.  In the JavaScript file, helloWorld.js, copy and paste the following code.
[import { LightningElement, track } from 'lwc';
export default class HelloWorld extends LightningElement {
    @track greeting = 'World';
    changeHandler(event) {
        this.greeting = event.target.value;
    }
}]

5.  In the XML file helloWorld.js-meta.xml, copy and paste the following code.
[<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="helloWorld">
  <apiVersion>45.0</apiVersion>
  <isExposed>true</isExposed>
  <targets>
    <target>lightning__AppPage</target>
    <target>lightning__RecordPage</target>
    <target>lightning__HomePage</target>
  </targets>
</LightningComponentBundle>]
Sample code Credits: Salesforce.com

COMMENTS

Name

Apex,6,Batch Apex,2,Chrome Add-on,1,Chrome browser,1,Coding Best Practices,2,CRM Basics,1,cURL,1,Database Query,1,Dataset,1,Dynamic Apex,3,Dynamic SOQL,1,Einstein Analytics,9,Future Apex,1,Git,1,Google Chrome,1,JS for LWC,6,Lightning Components,2,lightning Page,1,Lightning Web Components,13,Linux for Windows users,1,LWC,2,Queueable Apex,1,Redirect page,1,REGEX,1,REST API,1,Salesforce CRM,1,Salesforce Errors,1,Salesforce Interview Questions,13,Salesforce Lightning,1,Salesforce New Features,1,Salesforce Tasks,2,Schedule Apex,1,Test Class,1,Triggers,1,Visualforce Pages,3,Visualforce Pagination,2,VS Code,2,Wave Analytics,7,Winter Release Notes,1,workbench,1,
ltr
item
SWDC WORLD (Software Development Center Of The World) - is a Multi author and Multi Technology Blog: Create a Salesforce DX Project in Visual Studio Code
Create a Salesforce DX Project in Visual Studio Code
Create a Salesforce DX Project in Visual Studio Code,Authorize Your Developer org,Create a First Lightning Web Component, lightning web component structure,Create Hello World Lightning web component
https://1.bp.blogspot.com/-hPBC3FwCm2U/XOkIRXHVXEI/AAAAAAAAATI/TsH-LLJqoKEbK7j9HFCDE_ZpoISeNeVZgCLcBGAs/s400/VS-Code-Project.png
https://1.bp.blogspot.com/-hPBC3FwCm2U/XOkIRXHVXEI/AAAAAAAAATI/TsH-LLJqoKEbK7j9HFCDE_ZpoISeNeVZgCLcBGAs/s72-c/VS-Code-Project.png
SWDC WORLD (Software Development Center Of The World) - is a Multi author and Multi Technology Blog
https://swdcworld.blogspot.com/2019/05/create-salesforce-dx-project-in-visual.html
https://swdcworld.blogspot.com/
https://swdcworld.blogspot.com/
https://swdcworld.blogspot.com/2019/05/create-salesforce-dx-project-in-visual.html
true
5370056087523941001
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy