VS-Code Extension

About the Plugin

In recent times, Salesforce has promoted VS Code as a go-to IDE for development. VS Code can be used for creating customization code as well as managing the configuration files. There are several extensions that are specifically built for Salesforce development. Some of these extensions are built by Salesforce itself, whereas some are built by other developers. Similarly, we have built a VS Code extension that can help you create the plays from the VS Code without logging in again into PlayGround / Salesforce or Version Control.

Installing the Extension

Open the Visual Studio Code and open the Extension options from the sidebar.

Search for Playground extension in the marketplace. A user would get all the extensions that have Playground in the name or description. Select the following one:

Click on Install to install the extension in VS Code.

Generating App Password

To connect VS code with Playground, the user would need to generate an App Password in the Playground and consume the details in VS Code. Log into the Playground and click on the user details on the top right. Select the Profile option to see profile details and customize it.

From the left sidebar menu, click on App Passwords, This would open the existing app passwords (if created earlier), and it gives an option to create a new app password. Click on New button. It opens a pop-up to create a new app password. Enter a meaningful name like VSCode. Click Continue, once done.

Copy the app password. Make sure to note it safely (if needed), as it will not be visible after you move away from the page.

Get User Nickname

Remaining on the profile details page, click on the General link on the sidebar. Copy the nickname. It will be needed later while connecting VS Code with Playground application.

Connecting VS Code with Playground

Once the password is generated, configure VS Code editor & establish a connection. Click on the Playground: Connect button on the bottom status bar, as shown below.

On button click, it will ask for Nickname & Password. Use your nickname & password generated here. Nickname Enter Nickname Enter Password

Extension Usage

Once everything is set up, the Uploading project to the Playground is a single click task. We will be exploring that as we move forward. If you create a play using the extension and need to update the metadata, you only need to repeat the process, and it will override the changes itself.

This extension comes with two actions i.e. Playground: Connect & Playground: Push Changes. All of these can be handled by following either of the things above. It comes with one fancy open link button as well to see you existing.

Extension Commands

If buttons are not visible, use the following commands from Command Palette:

  • Connect: Run this command to reset your login if required to replace it with the new App Password.
  • Push & Create Play: Creates a play by pushing all files in your Salesforce Project.
  • Push & Update Play: Updates the current play by sending your changed files to the Playground.