After completing this unit, you’ll be able to:
DreamHouse is a realty company that provides a way for customers to shop for homes and contact real estate agents online. DreamHouse brokers use some of Salesforce’s standard functionality, like contacts and leads, to track home buyers.
But when it comes to selling houses, there are a lot more things they want to track. For example, Salesforce doesn’t include a standard way to track properties. How is DreamHouse supposed to know which homes they have for sale or how much each home costs?
Luckily, their Salesforce admin, D’Angelo, knows that the Salesforce platform offers a solution. We’ll work with D’Angelo to see what he’s building.
Let’s start with the data model. A data model is more or less what it sounds like. It’s a way to model what database tables look like in a way that makes sense to humans.
If you’re not familiar with databases, think about storing data in a spreadsheet. For example, D’Angelo can use a spreadsheet to track all DreamHouse’s properties. Columns can store the address, cost, and other important attributes. Rows can store this information for each property that DreamHouse is selling. Database tables are set up in a similar way.
But looking at data in tables isn’t ideal for humans. That’s where the data model comes in.
In Salesforce, we think about database tables as objects, we think about columns as fields, and rows as records. So instead of an account spreadsheet or table, we have an Account object with fields and a bunch of identically structured records.
When we talk about the data model, we’re talking about the collection of objects and fields in an app. Let’s learn more about objects and fields so you can start building your own data model.
Salesforce supports several different types of objects. There are standard objects, custom objects, external objects, platform events, and BigObjects. In this module, we focus on the two most common types of objects: standard and custom.
Standard objects are objects that are included with Salesforce. Common business objects like Account, Contact, Lead, and Opportunity are all standard objects.
Custom objects are objects that you create to store information that’s specific to your company or industry. For DreamHouse, D’Angelo wants to build a custom Property object that stores information about the homes his company is selling.
Objects are containers for your information, but they also give you special functionality. For example, when you create a custom object, the platform automatically builds things like the page layout for the user interface.
Let’s work alongside D’Angelo to see how he builds the Property object. We need this object later, so don’t skip these steps!
Note: Even if you're completing this module as part of the Admin Beginner trail, be sure and create a new Trailhead Playground to complete these steps. You don't need to reinstall the Dreamhouse app in the new playground org.
Great job! You just created your first custom object. Now, let’s talk about adding fields to this object.
Every standard and custom object has fields attached to it. Let’s get familiar with the different types of fields.
Field Type | What is it? | Can I get an example? |
---|---|---|
Identity |
A 15-character, case-sensitive field that’s automatically generated for every record. You can find a record’s ID in its URL. |
An account ID looks like 0015000000Gv7qJ. |
System |
Read-only fields that provide information about a record from the system, like when the record was created or when it was last changed. |
CreatedDate, LastModifiedById, and LastModifiedDate. |
Name |
All records need names so you can distinguish between them. You can use text names or auto-numbered names that automatically increment every time you create a record. |
A contact’s name can be Julie Bean. A support case’s name can be CA-1024. |
Custom |
Fields you create on standard or custom objects are called custom fields. |
You can create a custom field on the Contact object to store your contacts’ birthdays. |
Identity, system, and name fields are standard on every object in Salesforce. Each standard object also comes with a set of prebuilt, standard fields. You can customize standard objects by adding custom fields, and you can add custom fields to your custom objects.
Every field has a data type. A data type indicates what kind of information the field stores. Salesforce supports a bunch of different data types, but here are a few you’ll run into.
Again, there are quite a few field types, but most of them are fairly self-explanatory. The important takeaway here is that you want to think about what kind of data you’re trying to store when you create a custom field.
The Property object we just created is pretty bare-bones. Let’s add some custom fields to it. Head back to your Trailhead Playground.
You’ll see your new Price field in the list of Property fields. In the Field Name column, notice that it says Price__c. The “__c” part is an easy way to tell that a particular field is a custom field.
Let’s create a property record to see what you did.
While it can seem easy to add and customize objects, remember that what’s going on under the hood is technically complicated. Here are some best practices to keep in mind as you start customizing your own org.
Be thoughtful about names. Once you start creating a bunch of objects, it can be tempting to give them “lazy” names. For example, if D’Angelo created another custom object to track condominiums, he might be tempted to name it “Property2” instead of “Condominium.” That’s a recipe for confusion in your org. Give your objects and fields descriptive, unique names to improve clarity.
Help out your users. Even with careful naming, your users might not always be clear about the purpose of a particular object or field. Include descriptions for your custom objects and fields. For specialized or complicated customizations, use help text to give more details.
Require fields when necessary. Sometimes, you’ll want to force your users to fill out a field when they’re creating a record on a certain object. Every property needs a price, right? Make important fields required to avoid incomplete data.
Click to return to the unit on Trailhead to access your challenge and proceed to the next step.