About the Plugin
In the 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 configration files. There are number of extensions that are specifically built for Salesforce development. Some of these extensions are built by Salesforce itself where as some are built by other developers. Similarly, we have built a VS Code extension that can help you create the plays from VS Code without having to log in again into PlayGround / Salesforce or Version Control.
Installing the Extension
Open Visual Studio Code and open the Extensions options from sidebar.
Search for Playground extension in the marketplace. User would get all the extensions which has 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, user would need to generate an App Password in Playground and consume the details in VS Code. Log into Playground and click on the user details on top right. Select 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 buttton. 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 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 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
Once everything is set up, Uploading project to Playground is a single click task. We will be exloring 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
If buttons are not visible, use the following commands from Command Pallette:
- 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 Playground.