1

How do I tell Visual Studio Code to use the Symbols from the Sandbox org?

I would like to develop Apex using Visual Studio Code, and get code completion based on the configuration / meta-data in a Sandbox org.

How can I get Visual Studio Code to provide Apex code completion against a Sandbox Org using Salesforce DX?

2
  • Standard CTRL+Space is not working? Note that Lightning completion is not supported yet. Commented Sep 2, 2018 at 13:35
  • 1
    Salesforce has published a preview version of the CLI and the VS Code extensions to allow you to develop against non-scratch orgs. Worth a look: github.com/forcedotcom/salesforcedx-vscode/wiki/…
    – Mark Pond
    Commented Sep 4, 2018 at 19:54

1 Answer 1

4

The latest release of the Salesforce Extensions for VS Code and the Salesforce CLI added a preview 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.

You will need to install the preview release of the Salesforce CLI and enable the preview features in VS Code. You can do this by running the following commands:

 sfdx plugins:install salesforcedx@pre-release

Next you need to enable the feature in VS Code.

To open your user and workspace settings, use the following VS Code menu command:

  • On Windows/Linux - File > Preferences > Settings
  • On macOS - Code > Preferences > Settings

Set the following setting in your user settings:

 "salesforcedx-vscode-core.change_set_based_tools.enabled": true

Close and open VS Code and create a project.

To create a project with a manifest run from the command palette:

 SFDX: Create Project with Manifest

Alternatively, you can use the CLI to create the project:

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

Change a setting to force the commands to work against API version 43:

 sfdx force:config:set apiVersion=43.0

If you want to connect to a sandbox org, edit file:

sfdx-project.json 

Set sfdcLoginUrl to:

https://test.salesforce.com

Authorize the org via the command palette:

 SFDX: Authorize an Org

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

Reference:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .