Before You Start
- Determine if you have the skills to complete this module.
- Create a required custom object.
- Configure your org for Lightning components development.
We know. You’re rarin’ to get started. And far be it from us to dampen anyone’s enthusiasm for Lightning components or Trailhead! But before you settle in to work through this module, we have a few things you should do. We suggest you do them before you plan to start the subsequent units, to avoid errors about missing objects or otherwise wasting your time.
The first thing we’ll do is discuss My Domain. My Domain is required to develop with Lightning components, and it’s also a pretty cool feature you should consider for your production org. We’ll also create a necessary custom object, the Expense object, in your org.
Last, we need to have a chat about whether you want to take this module on. Nobody likes to be excluded, but really, this module isn’t for everyone. So we want to take a moment and talk about who this module is for, and skills you’ll need to complete it.
We know this sounds like we’re harshing on your excitement. We hate that as much as you do. But we want to be respectful of your time. If this isn’t the right module for you, let’s get you pointed at a different part of Trailhead, so your time with us is fun and challenging, without being frustrating.
In your production org, My Domain lets you create a subdomain unique to your organization. With My Domain, you replace the instance URL that Salesforce assigns you, such as https://na17.lightning.force.com, with your chosen subdomain, for example, https://mydomainname.lightning.force.com.
My Domain is required to create custom Lightning components and set up single sign-on (SSO) in an org. To learn more about My Domain, check out this knowledge article. To learn how to activate it in your production org, see the User Authentication module.
While we assume that you know how to create a custom object already, here are brief instructions, and the specifics for the Expense object and its fields.
Go to the Object Manager.
From Setup, at the top of the page, click Object Manager.
Create the custom object.
Define the Expense object.
Enter the following values for the object’s definition.Accept the defaults for the rest of the object definition.
Field Value Label Expense Plural Label Expenses Starts with vowel sound checked Object Name Expense
Add custom fields to the Expense object.
Scroll to the Fields & Relationships section of the object details page. For each of the following fields, click New and define the field with the following details.
Field Type Field Label Field Name Properties (otherwise accept defaults) Number Amount Amount Length: 16, Decimal Places: 2 Text Client Client Length: 50 Date Date Date Checkbox Reimbursed Reimbursed
One of the great things about Salesforce is how much you can customize it using the app. Custom objects and fields, formulas, flows, reports, approvals, and even the user interface itself—you can do all of these things and more from Setup, without writing a line of code, and make your users very happy.
But there are some features of Salesforce that require code, and the Lightning Component framework is one of them. There are no two ways about it: to be successful with Lightning components, you need to be able to read and write code. We will look at a lot of code throughout this module, and you have to write a fair bit yourself to pass the challenges.
Specifically, we think that:
use HTML-style markup, doing anything beyond “hello world” requires
- It would be great if you know Apex. Reading and writing data from Salesforce usually uses
Apex, and that’s what we’ll learn in this module. You can pass the challenges in
this module without being an Apex guru, but when you go to write real apps, you’ll
be writing plenty of Apex.
The Apex Basics & Database module is a great way to get started with Apex, and will give you everything you need for this module.
- If you’re coming to Lightning components from Visualforce, be sure to add the Apply Visualforce Skills to Lightning Components trail to your task list. Lightning components have a couple of differences that often trip up Visualforce developers. More importantly, it’s several more badges, and all of them together are easier than this one.
If this list doesn’t describe you, we don’t want to turn you away. It’s not impossible to complete this module without the preceding skills. But we do think it will be frustrating. And while you might earn the badge—which is definitely cool!—you won’t really be ready to use Lightning components to write apps.
We want Trailhead to be fun, and we want it to help people use Salesforce more completely and confidently. Experienced programmers will get a lot out of this module. But grinding through it without the requisite programming background might not be the best use of your Trailhead Time.
OK. With that out of the way, let’s dive in and start learning!