Get Ready to Develop
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.
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.
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.
- A Salesforce development environment, which is also called an org
- Salesforce command line interface (CLI) to manage the application development lifecycle
- Visual Studio Code (VS Code) installed with the Salesforce Extension Pack (Expanded) extension
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.
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.
- Click to launch the App Launcher, then search for and click Playground Starter.
- Click the Get Your Login Credentials tab. Here you can see your Trailhead Playground username.
- Click Reset My Password, then click Ok. This sends an email to the address associated with your username.
- 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.
- Install the Salesforce CLI.
- Confirm the CLI is properly installed and on the latest version by running the following command from the command line.
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.
- 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.
- Launch Visual Studio Code.
- On the left toolbar, click Extensions.
- Search for Salesforce Extension Pack (Expanded) in the search field, click Salesforce Extension Pack (Expanded) and click Install.
- In Visual Studio Code, open the Command Palette by pressing Ctrl+Shift+P (Windows) or Cmd+Shift+P (macOS/Linux).
SFDXto filter for commands provided by the Salesforce extensions.
Create a New Salesforce Project
To create a new Salesforce project and connect the project to your Trailhead Playground org, follow these steps.
- Open Visual Studio Code on your computer.
- Open the Command Palette by pressing Ctrl+Shift+P (Windows) or Cmd+Shift+P (macOS/Linux).
- Select SFDX: Create Project.
- Press Enter to accept the Standard option.
Dreamhouseas the project name.
- Select a folder on your device to store the project.
- Click Create Project. You should see the following as your base setup.
- Open the Command Palette again and enter
SFDX: Authorize an Org. Choose Production in the next screen and then provide the org alias as
- 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.
- 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
- Your project is now connected to the Trailhead Playground, and you can use
sf org opencommand to open the org. Alternatively, you can click to open the org.
- Install built-in Node.js scripts and utilities for code linting and formatting.
- Open the Command Palette (⇧⌘P), search for View: Toggle Terminal command and select it to open the terminal in VS Code.
npm installin the terminal to complete the tooling setup.
- 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!
- Trailhead: Trailhead Playground Management
- External Video: Developer Tools | Modern App Development on Salesforce
- External Link: Salesforce Extension Pack (Expanded)
- Salesforce Developers Blog: Make the Most of Your DX Projects with Built-in Node.js Scripts
- Trailhead: Determine Which Application Lifecycle Development Model Is Right for You