Develop Against Any Org in Visual Studio Code

lcampos edited this page Nov 19, 2018 · 17 revisions

The latest release of the Salesforce Extensions for VS Code and the Salesforce CLI added an open beta of basic support for developing against non-scratch orgs. This means you can now use VS Code with your package.xml file against Scratch Orgs, Developer Edition Orgs, etc. This release is limited in functionality as it is an open beta and we suggest you only use it to evaluate features and provide us with feedback - it is not recommended to use in your day to day work yet.


Table of Contents

  1. Getting Started
  2. Source Format
  3. Bugs and Feedback

Getting Started

First, Open VS Code and create a project. To create a project with a manifest run the command SFDX: Create Project with Manifest.

Create project

Alternatively you can use the CLI to create the project.

sfdx force:project:create --projectname myproject --manifest
cd mychangeset
code .

Next, you will need to authorize the org you will be working with.

If you want to connect to a sandbox org, edit your sfdx-project.json file to set sfdcLoginUrl to before you authorize the org.

To start the login process, run the command SFDX: Authorize an Org.

Authorize an Org

Your browser will open and you can login to your Sandbox, Developer Edition, trial, etc. Once you have authenticated, you can close the browser and return to VS Code.

The new project you created came with a default manifest file located at manifest/package.xml. Right-click this file and select the command SFDX: Retrieve Source from Org

Retrieve source from org

After you make code changes, you can deploy these changes to your org by running the SFDX: Deploy to Org command on either:

  1. A manifest file.
  2. A folder
  3. A file

Deploy source to org

Source Format

Note, that the format of the source code is in the new "source" format. This means that you cannot open your existing code from IDE in VS Code. You either need to convert your code to source format or create a new project and retrieve the code from your org using your existing manifest (package.xml) file.

For information on converting to source format and maintaining git history see this blog post.

Bugs and Feedback

To report issues with these features or for anything else related to the Salesforce Extensions for VS Code, open a bug on GitHub. If you would like to suggest a feature, create a feature request on Github.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.