Home

Awesome

xysfdx README

xysfdx is a Rapid development tool for Salesforce SFDX Development. Metadata diff with server, retrieve standard sobject.

Features

Shortkey

shortkey: ctrl+shift+j

Requirements

Salesforce Cli

Usage

Create a project

force:project:create

xycode-sfdx-init-project

Retrieve metadata

force:source:retrieve:metadata

xycode-sfdx-retrieve-meta

Diff metadata

force:source:diff:metadata

You can diff with any sfdc organization.

diff source

xycode-sfdx-diff-meta

diff profile

xycode-sfdx-diff-profile-meta

Authentication

force:auth:web:login force:auth:web:login:setdefaultusername

Deploy metadata

Dataloader

xysfdx-dataloader

If you use docker, you can only select csv/sdl file in current workspace.

TIPS: How to create sdl file ? I always use SalesforceXyTools For Chrome to create it.

Option Features

How to config option features

You can also open the Settings editor from the Command Palette (Ctrl+Shift+P) with Preferences: Open Settings or use the keyboard shortcut (Ctrl+,).

search xysfdx

xysfdx-setting

Build-in Option Features

xysfdx.optionFeatures config:

config:

{
    "xysfdx.optionFeatures": [
        // show advanced command
        //"use_advanced_command",

        // auto deploy to `.trigger`, `.cls`, `.component`, `.page` file to sfdc
        // "auto_save_to_sfdc",

        // pretty `.cmp`, `.page`, `.component` file
        // "pretty_vf_page",

        // pretty `.trigger`, `.cls` file
        // "pretty_apex",

        // run `.apex` file after save it, default active
        "auto_run_apex_anonymous",

        // pretty `.apex` file
        "pretty_apex_anonymous",
		
		// use git 
        "git",
		
		// use sfdc-cli, read more: https://github.com/exiahuang/sfdc-cli
        "xytools",
        "xytools.auto_save_to_server",
        "xytools.auto_run_apex_anonymous",
		
    ]
}

show advanced command

auto run apex anonymous code

auto_run_apex_anonymous

xycode-sfdx-run-apex-anonymous

auto save to sfdc server

auto_save_to_sfdc

xysfdx-auto-save-to-sfdc

pretty code

you need to install java and prettier and prettier-plugin-apex npm install --global prettier prettier-plugin-apex sudo apt install openjdk-8-jdk read more about prettier-plugin-apex

xysfdx-pretty_apex

use git

set git option features, then use the base git command.

git config json

use sfdc-cli

set xytools option features, then use the sfdc-cli command.

please do not use xytools.auto_save_to_server and auto_save_to_server in the same time please do not use xytools.auto_run_apex_anonymous and auto_run_apex_anonymous in the same time

read more about sfdc-cli:

For Docker user

vscode config

{
    "xysfdx.shellMode": "docker",
    "xysfdx.shellPath": "",
    "xysfdx.dockerContainer": "${lowercaseWorkspaceName}_sfdx_1",
    "xysfdx.dockerAppRoot": "/app/sfdx"
}

How to use docker ?

  1. pull images : docker: pull image exiasfdc/sfdx

xysfdx-docker-image

  1. create container : docker: create sfdx container

xysfdx-docker-container

  1. use docker shell : docker: attach docker shell

xysfdx-docker-bash

then , use the xysfdx to develope sfdx.

attention

For Windows user

use wsl/git bash/Msys2 bash to develope sfdx.

Open cmd/wsl/bash

xysfdx-open-wsl.png

xysfdx-open-wsl

use wsl

open wslmode

{
    "xysfdx.shellMode": "wsl",
    "xysfdx.shellPath": "C:\\Windows\\System32\\bash.exe"
}

use msys2 bash

{
    "xysfdx.shellMode": "bash",
    "xysfdx.shellPath": "C:\\msys64\\usr\\bin\\bash.exe"
}

use git bash

{
    "xysfdx.shellMode": "bash",
    "xysfdx.shellPath": "C:\\Program Files\\Git\\usr\\bin\\bash.exe"
}

Enjoy it!