Extension to deploy/retrieve data to/from Salesforce
The extension adds support for the SFDX Data Deploy Plugin.
- Write deployment descriptor files with JSON validation and code completion.
- Utilize code snippets for deployment descriptor files.
- Deploy data files in workspace folders to Salesforce using the command palette.
- Retrieve data files from Salesforce to workspace folders using the command palette.
- Deploy data files in workspace folders to Salesforce using the explorer context menu.
- Retrieve data files from Salesforce to workspace folders using the explorer context menu.
- Install Salesforce CLI.
- Install SFDX Data Deploy Plugin (version 2.3.0 or higher)
- Connect Salesforce CLI to your Salesforce Org and set it as default org (e.g. using
-s
with theforce:auth
command). - Open a workspace or folder in Visual Studio Code.
Using the quick open menu (Ctrl+P / Cmd+P):
ext install georgwittberger.sfdx-data-deploy-vscode
Create a JSON file and type the word sfdx
or datadeploy
to view a list of code snippets.
Snippet | Description |
---|---|
sfdx-datadeploy-descriptor |
Scaffold of a deployment descriptor with a blank jobs list |
sfdx-datadeploy-job |
Scaffold of a deployment job with placeholder for sObject name |
sfdx-datadeploy-job-config |
Scaffold of a deployment job configuration (use inside job object) |
In the editor of a datadeploy.json
file you will benefit from JSON validation and code completion. For example, press Ctrl+Space / Cmd+Space inside the job configuration objects to view a list of available configuration properties.
Using the command palette (Ctrl+Shift+P / Cmd+Shift+P):
- Open the command palette and type
sfdx data
. - Select the command
SFDX: Deploy Data To Org
. - Select the deployment directory from the displayed list.
- Select the data files to deploy from the displayed list or press Enter right away to deploy all files.
Using the explorer context menu:
- Right-click on a deployment directory in the explorer view.
- Select
SFDX: Deploy Data From Folder To Org
from the context menu. This will deploy all data files in the folder.
Using the command palette (Ctrl+Shift+P / Cmd+Shift+P):
- Open the command palette and type
sfdx data
. - Select the command
SFDX: Retrieve Data From Org
. - Select the deployment directory from the displayed list.
- Select the data files to retrieve from the displayed list or press Enter right away to retrieve all files.
Using the explorer context menu:
- Right-click on a deployment directory in the explorer view.
- Select
SFDX: Retrieve Data From Org To Folder
from the context menu. This will retrieve all data files in the folder.
- SFDX commands are always run against your default org. If you have connected Salesforce CLI to multiple orgs make sure that the right one is set as default org.
- Explorer context menu items also appear for directories which do not contain any deployment descriptor. This is due to limitations of Visual Studio Code for controlling the visibility of menu items.