About

all about SFDC

Friday 7 June 2019

Import existing Salesforce project in Visual Studio Code

11:38

This blog post describes how to import an existing Salesforce projects in Visual Studio Code. Primarily this process will consists 3 major steps such as creating project, authorizing an org and importing all existing components. Before creating project we should have installed salesforce extensions pack for Visual Studio code and also Salesforce CLI and JDK 8 is must in order to work these extensions. The Visual Studio Code can run SFDX commands from its terminal.






After installing the extension pack. The first step is to create project.Always Choose the option to create a project with manifest because when you do create a project with manifest it will populate some files for you such as package.xml with apex classes and triggers and Ltng Components.





Once created the project in local we need to authorize/connect Salesforce Org to the project. To do this type Ctrl+Shift+P  and choose SFDX:Authorize an Org command from command palette and choose instance url either for Sandbox or dev org. Leave the org alias empty and click enter and this action will open the Salesforce login screen in browser and once done





After successful authorization next step is to import all metadata to our local/Visual Studio Code. Check the package.xml file in project tree and then right click on it and choose the command SFDX: Retrieve Source in Manifest from Org and this action can also be done from command palette when package.xml file is open. This is the only action, even just in case we want to import newly created metadata components  by other developers during development  from org  . The command SFDX:Retrieve Source from Org will only refresh the existing meta data components from updated versions in Org and it won't import newly created metadata components such as classes etc to local.






Note: While setting up JDK 8, the JAVA_HOME system variable is necessary.

Resources:
Quick Start: Visual Studio Code for Salesforce Development

Org Development Model

Salesforce Extension Pack

Cheers!!

0 comments

Note: only a member of this blog may post a comment.

Powered by Blogger.

Contact form

Name

Email *

Message *

Visualforce

Apex

Lightening UI

Translate

Comments