Skip to main content
The Trailblazer Community will be unavailable from 10/19/2024 7:00PM PDT to 10/19/2024 10:00PM PDT. Please plan your activities accordingly.

Get Ready to Develop

Learning Objectives

In this project, you'll:

  • Set up a Salesforce development environment.
  • Create a data model in Salesforce.
  • Write Apex code to retrieve data from Salesforce objects.
  • Learn to create and deploy a Lightning web component (LWC).

Welcome to the World of Salesforce Development

We're excited that you're here to learn all about Salesforce development. This project gives you a peek into what it's like to develop on the Salesforce Platform.

Developers value the Salesforce Platform because of the:

  • Speed and efficiency of application development
  • Availability of built-in tools and services for managing user identity and authentication, data security and permissioning, and more
  • Ability to build custom solutions on top of your customer data

Well-built business solutions are complex and require resources for managing various stacks and services. The graphic illustrates how developers can simply focus on the application logic and data while the Salesforce Platform handles the rest.

Platform-managed versus Developer-managed stacks and services on Salesforce.

About This Project

In this project, you build an application for a fictitious company, DreamHouse Realty. The feature you work on allows DreamHouse agents to manage available houses and visualize them on a map.

You start by setting up the development tools you need to build the application. Then, you create the data model and write backend code using Apex, a programming language created by Salesforce that's optimized to run in the Salesforce multitenant architecture. Salesforce automatically creates a fully functional UI to perform create, read, edit, and delete (CRUD) data, but you build a custom front-end feature using JavaScript and Lightning web components.

Follow Along with Trail Together

Want to follow along with an expert as you work through this step? Take a look at this video, part of the Trail Together series.

Set Up Your Development Tools

To develop applications on Salesforce, you need the following tools.

  1. A Salesforce development environment, which is also called an org
  2. Salesforce command line interface (CLI) to manage the application development lifecycle
  3. Visual Studio Code (VS Code) installed with the Salesforce Extension Pack (Expanded) extension
Note

Note 

A Salesforce Platform environment is a single tenant in the platform's multitenant architected environment. You can learn more about multi-tenancy by reading the Salesforce Multitenant Architecture whitepaper.

Create a New Trailhead Playground

As we mentioned, orgs are the environments for building and running Salesforce applications. The kind of org you use for hands-on activities and challenges in Trailhead is called a Trailhead Playground. You will learn about other types of orgs as you learn more about the Salesforce platform.

Note

Note 

You use a Trailhead Playground org as the development environment for this project. Salesforce provides other development environments, including scratch orgs, sandboxes, and Developer Edition orgs. The type of org you use depends on the application lifecycle model of the project.

To learn more about scratch orgs and other development tools in the Salesforce ecosystem, check out the videos and other references in the Resources section.

For this project, you need to create a new Trailhead Playground. Yes, we really mean a brand-new Trailhead Playground! If you use an existing org or playground, you can run into problems completing the challenges. To create a new Playground, scroll to the bottom of this page, click the Playground name, then click Create Playground. It typically takes 3–4 minutes to create a new Trailhead Playground.

Reset Your Password for Your Trailhead Playground Org

The integration between Trailhead and the Playground org makes the default password inaccessible. You need a password to access the org from outside of Trailhead, such as from developer tools like Salesforce CLI and VS Code.

To reset the Trailhead Playground password, follow these steps.

  1. Click App Launcher to launch the App Launcher, then search for and click Playground Starter.
  2. Click the Get Your Login Credentials tab. Here you can see your Trailhead Playground username.
  3. Click Reset My Password, then click Ok. This sends an email to the address associated with your username.
  4. Click the link in the email. Enter a new password, confirm it, and click Change Password.

Install the Command Line Interface (CLI)

Salesforce CLI is the command-line tool for working with the Salesforce Platform. With Salesforce CLI, you can easily create environments for development and testing. Salesforce CLI also has commands to synchronize source code between your orgs and version control systems and to execute unit tests. 

See the Salesforce CLI Setup Guide for complete installation instructions for CLI.

  1. Install the Salesforce CLI.
  2. Confirm the CLI is properly installed and on the latest version by running the following command from the command line.
    sf update

Install Visual Studio Code and the Salesforce Extension Pack

Visual Studio Code is the Salesforce supported code editor for developers. The Salesforce extension pack contains features that leverage the Salesforce CLI to streamline development.

  1. Download and install the latest version of Visual Studio Code for your operating system. If you already have Visual Studio Code installed, there's no need to reinstall it.
  2. Launch Visual Studio Code.
  3. On the left toolbar, click Extensions.
  4. Search for Salesforce Extension Pack (Expanded) in the search field, click Salesforce Extension Pack (Expanded) and click Install.
    The VS Code extension Salesforce Extension Pack (Expanded).
  5. In Visual Studio Code, open the Command Palette by pressing Ctrl+Shift+P (Windows) or Cmd+Shift+P (macOS/Linux).
  6. Enter SFDX to filter for commands provided by the Salesforce extensions.
Note

Note 

Some features, particularly Apex support, in Salesforce Extensions for Visual Studio Code depend on the Java Platform, Standard Edition Development Kit (JDK). Once you install the correct JDK, use the following link to configure your setup: Salesforce Extensions: Java Setup.

Create a New Salesforce Project

To create a new Salesforce project and connect the project to your Trailhead Playground org, follow these steps.

  1. Open Visual Studio Code on your computer.
  2. Open the Command Palette by pressing Ctrl+Shift+P (Windows) or Cmd+Shift+P (macOS/Linux).
  3. Type SFDX.
  4. Select SFDX: Create Project.
  5. Press Enter to accept the Standard option.
  6. Enter Dreamhouse as the project name.
  7. Select a folder on your device to store the project.
  8. Click Create Project. You should see the following as your base setup.
    Sample project directory structure for a Salesforce project.
  9. Open the Command Palette again and enter SFDX: Authorize an Org. Choose Production in the next screen and then provide the org alias as myDevOrg.
  10. Your browser opens a Salesforce login page. Enter your credentials for your Trailhead Playground org. If prompted, click Allow to allow Salesforce CLI to perform actions against your org, such as code deploy.
  11. Install the long-term support (Active LTS) version of Node.js on your computer. To install the LTS version, go to https://nodejs.org/en/download/. To confirm the successful installation run node --version
  12. Your project is now connected to the Trailhead Playground, and you can use sf org open command to open the org. Alternatively, you can click browser icon to open the org.
    Icon to open your connected Salesforce org from VS Code directly.
  13. Install built-in Node.js scripts and utilities for code linting and formatting.
    1. Open the Command Palette (⇧⌘P), search for View: Toggle Terminal command and select it to open the terminal in VS Code.
    2. Type npm install in the terminal to complete the tooling setup.
    3. Open the Command Palette (⇧⌘P), search for Developer: Reload Window command, and select it to reload the VS Code.

Let's summarize what you just did to prepare for development.

  • You set up your Salesforce environment, also known as an org.
  • You installed and configured the Salesforce CLI.
  • You made VS Code ready to work with your Salesforce project.

Congratulations–you're now ready to code!

Resources

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback