Get Set, Go with VS Code for Salesforce


Salesforce have stopped the support for Eclipse Force.com IDE and has introduced the extension in VS Code. This is the only tool that is available from Salesforce where you can build Lightning Web Component. 

I have tried to make it easy by creating step by step instructions. 


Install the following:

1. Java-8 
4. Salesforce Extension in VS Code

Note:
Set path in the environment variable for Java & CLI.


Create Salesforce Project:

1. Open VS Code. Press Ctrl + Shift + p buttons. You will see command palette on the top. Type SFDX: Create Project with Manifest and select it.



2. Enter the project name.



3. Select the workspace where you want to create the project. In my case I have selected SFDC Workspace.



4. A project will be created. All the metadata is stored under force-app -> main -> default folder.




5. In this step you need to do the authorization of the org. Press Ctrl + Shift + p buttons, Type SFDX: Authorize an Org in command palette and select it. It will ask for login URL. Select Project Default if it is Dev/Production org.




6. It will ask to set the default alias name for the org. In my case I have set it as NumaanDevOrg. Set the name and hit enter. It will authorize a Salesforce org by opening the login page in browser.



7. Specify the metadata that you want to retrieve by opening the package.xml file in metadata folder. Right click on the package.xml and select SFDX: Retrieve Source in Manifest from Org. There are many options to retrieve metadata, You can check the options here.




8. To deploy the metadata to Org there are two ways. One option is to press ctrl+s to save then right click on the file and select SFDX: Deploy This Source to Org. Second option is to deploy the metadata automatically on save (ctrl+s). To enable this feature, we need to config in VS Code. Go to File -> Preference -> Settings -> Click on Extensions -> Select Salesforce Feature Previews -> Click on Edit under Push-or-deploy-on-save option.


Enjoy coding....
  

No comments:

Post a Comment