Skip to main content

Prepare Your Org and Install Developer Tools

Learning Objectives

After completing this unit, you'll be able to:

  • Set up your workspace for Salesforce development.
  • Install the unmanaged package for this module.

A Map of Your Adventure

Your adventures working with metadata have likely been full of twists and turns. So far, you've probably only migrated metadata using change sets, or maybe with unlocked packages using Salesforce CLI. For this hands-on challenge, you learn how to pull and migrate metadata with an XML manifest file, and use the Salesforce CLI commands to make it happen. First, set up your workspace.

Install and Update Visual Studio Code

Before you can write any code, you need to install a code editing tool. Visual Studio Code is a powerful editor that is highly customizable and cross-platform. Salesforce Extensions for Visual Studio Code is the successor to the Force.com IDE plug-in for Salesforce development on the desktop. Let's install Visual Studio Code (VS Code) and set up the extension.

  1. Install Visual Studio Code from https://code.visualstudio.com/Download.
  2. Open the Visual Studio Code application.

Install Visual Studio Salesforce Extension

The Salesforce extensions provide features such as code completion, syntax highlighting, Apex debugging, and more for the Lightning Platform.

  1. In Visual Studio Code, click the View menu then choose Extensions.
  2. Enter salesforce extension pack in the search box.
  3. Click Install (or Update) for the Salesforce Extension Pack result.
    Installing Salesforce Extension Pack for Visual Studio Code.
  4. Once installed, relaunch Visual Studio Code to ensure the changes take effect.

You now have a powerful tool that enables you to do some pretty cool development projects. From here on, you use VS Code for all terminal commands and code editing.

Install and Update Salesforce CLI

Time to get another new tool to complement your new editor. For this hands-on challenge, you install (or upgrade, if you already have it installed) the Salesforce CLI. You can use CLI commands to easily create scratch orgs for developing and testing customizations, and synchronize source code between orgs and source repositories.

  1. Install Salesforce CLI from https://developer.salesforce.com/tools/sfdxcli.
  2. To confirm and upgrade Salesforce CLI is properly installed, Open VS Code and in the top navigation menu, select Terminal.
  3. Click New Terminal.
  4. Run the following command from the command line.
    sf update
  5. You should see output like salesforce/cli: Updating CLI....

Authorize Your Dev Hub

Now is a good time to double check that Dev Hub is enabled in your Trailhead playground.

  1. Scroll to the bottom of this page, select the Trailhead Playground you'll use to complete the hands-on challenge in this unit from the hands-on org dropdown, and click Launch.
  2. In your playground, click the Setup icon Setup and select Setup.
  3. From Setup, enter Dev Hub in the Quick Find box and select Dev Hub.
  4. Click Enable Dev Hub. Also select Enable Unlocked Packages and Second-Generation Managed Packages.

To authorize your playground, you need your username and password.

  1. In your playground, click Setup and select Setup.
  2. Enter Users in the Quick Find box, then select Users.
  3. Check the box next to your name. Take note of your username.
  4. Click Reset Password(s) and then OK. This step sends an email to the address associated with your username. If you don't see the email, check your spam folder.
  5. Click the link in the email.
  6. Enter a new password and confirm it.

Now you're ready to authorize your playground.

  1. In the VS Code app, click Terminal in the top navigation menu and select New Terminal.
  2. Log in to your playground and authorize the Salesforce CLI. This command also gives your org the alias DevHub.
    sf org login web -d -a DevHub
  3. When the Salesforce login page opens in your browser, enter the username and password you just got and click Log In.
  4. Click Allow to authorize the Salesforce CLI.

Once you've logged in, you see a success message in the terminal window.

Install the Unmanaged Package

When migrating or creating new features to an app, the metadata is already in an org. So we've created some sample metadata for you to use in this module. Think of it as a drop-shipment of goods in the form of an unmanaged package. Let's go ahead and install the package.

Note

To make sure you install the package in the correct org, log out of any existing orgs.

  1. Launch your Trailhead Playground by scrolling to the bottom of this page and clicking Launch.
  2. If you see a tab in your org labeled "Install a Package", great. Follow the steps below.
    1. Click the Install a Package tab.
    2. Paste 04tDn0000001uJm into the field.
    3. Click Install.
    4. Select Install for Admins Only, then click Install.
  1. If you don't see the Playground Starter app, copy https://login.salesforce.com/packaging/installPackage.apexp?p0=04tDn0000001uJm and check out Install a Package or App to Complete a Trailhead Challenge on Salesforce Help.
  2. When your package is finished installing, you see a confirmation page and get an email to the address associated with your playground.

You will be redirected to your org, where you can see what was installed as part of the package.

  1. Once you've installed the package, from the Setup menu, select Object Manager.
  2. Click the custom object Sticker to see the details of the custom object installed with the package.
  3. Select Home and enter Tab in the Quick Find box, and select Tabs.
  4. Under the Custom Object Tabs section, select Stickers. This is the new custom tab from the installed package.

Great job! Now that you have all your gear, let's get to your next adventure, writing your first XML file and migrating metadata.

Resources

Salesforce ヘルプで Trailhead のフィードバックを共有してください。

Trailhead についての感想をお聞かせください。[Salesforce ヘルプ] サイトから新しいフィードバックフォームにいつでもアクセスできるようになりました。

詳細はこちら フィードバックの共有に進む