Reader small image

You're reading from  Salesforce for Beginners - Second Edition

Product typeBook
Published inOct 2022
PublisherPackt
ISBN-139781803239101
Edition2nd Edition
Concepts
Right arrow
Authors (2):
Sharif Shaalan
Sharif Shaalan
author image
Sharif Shaalan

Sharif Shaalan was first introduced to Salesforce as an end user in 2007. His range of experience, from a sales rep to technical architect, helped him successfully lead more than 100 implementations including projects that were showcased on the main stage at Dreamforce. In 2013, Sharif was chosen as a Salesforce MVP, and in 2020 he was inducted into the Salesforce MVP Hall of Fame. Sharif is a regular speaker at Salesforce conferences and has obtained more than 10 Salesforce certifications. He is the founder and CEO of Agile Cloud Consulting and continues to be an active Salesforce community contributor
Read more about Sharif Shaalan

Timothy Royer
Timothy Royer
author image
Timothy Royer

Timothy Royer is the VP of Delivery at Agile Cloud Consulting and a Salesforce Certified Application Architect. Timothy began his Salesforce career in 2012 as an accidental administrator and has since participated in a number of implementations in a variety of roles. Timothy has experience as a Salesforce customer, a Salesforce partner, and as a member of the Salesforce.org professional services team.
Read more about Timothy Royer

View More author details
Right arrow

Using Data Modeling to Configure Objects for Your Business

One of the core features of using Salesforce is declarative development, also known as clicks, not code. This feature allows admins to build on the platform without actually having to write code. Admins have the ability to build custom objects to hold the necessary data and configure these custom objects for a business use case. By adding fields and different layouts to the objects, admins give end users the ability to easily interact with the objects as required for their day-to-day work. This process is known as data modeling.

In this chapter, we will cover the following topics in detail:

  • Salesforce data modeling
  • Creating custom objects
  • Creating custom fields
  • Creating and using page layouts
  • Creating and using record types
  • Utilizing the created customizations

With the help of these topics, you will be able to understand data modeling concepts, the use case for creating...

Technical requirements

For this chapter, log into your development organization and simply follow along as we create and customize a custom object.

Salesforce data modeling

A data model is a structured way of storing data in an application. The Salesforce platform provides a standard model as well as the tools to customize data models for custom functionality. There are three concepts that relate to these models, standard objects, custom objects, and relationships:

  • Standard objects include the objects we covered in part one of this book such as Accounts, Contacts, Cases, Opportunities, and Campaigns, along with many other ancillary standard objects.
  • Custom objects can be used to store information specific to a company’s use cases.
  • Relationships are used to connect objects (both standard and custom) to each other. There are two types of relationships, master-detail and lookup relationships. In this chapter, we will cover creating custom objects and the relationships used to connect these objects in further detail.

Now that we understand the concept of data modeling, let’s see how this...

Creating custom objects

As we discussed in the first section of this book, there are several standard objects, such as Accounts, Contacts, Opportunities, Leads, and Cases, all of which are part of the foundations for customer relationship management and sales.

Outside these core objects, there may be other use cases where you’ll need to create new custom objects to handle a business use case. Objects, also known as database tables, allow you to build the infrastructure needed to store this information. Objects are similar to spreadsheets, where the object is the tab, the columns are the fields, and the rows are the actual data that’s created and inserted into these objects. Let’s take a look at a business use case where you may need to create a custom object.

Business use case

You are the Salesforce admin at XYZ Widgets. A business use case has come up where your manager has asked you to track the Salesforce certifications held by the customers that...

Creating custom fields

Now that we have created our custom Certification object, the next step is to create the fields that will capture information on these objects. The first and most important field to create will be the relationship field so that we can connect Certifications to Contacts.

By going to the Setup | Object Manager tab, you can see how we begin the process of creating this field:

Graphical user interface, application, email  Description automatically generated

Figure 13.8: List of fields and an option to add a new field to the custom object

As shown in the preceding screenshot, there are four fields that were automatically created when the object was created (1). These are Certification Number, Created By, Last Modified By, and Owner. To create a new field, click on New (2).

The following screenshot shows the New Custom Field page. Notice the description of each field type as you create the necessary fields:

Graphical user interface, application  Description automatically generated

Figure 13.9: Selecting the data type when creating a custom field

As shown in the preceding screenshot, there...

Creating and using page layouts

Page layouts are the user interfaces where we interact with the object and fields that we created. When looking at page layouts, there are two types to consider. The first is the Lightning page layout, which is used for configuring the layout for a record in the Lightning Experience and includes many usability options.

You can read more about Lightning page layout in the Further reading section at the end of this chapter, We will also cover this in more detail in Chapter 14, Lightning Experience Customization.

The second is the page layout related to the actual object. This is the page layout we will look at in this section. It maps directly to the Details section of a Lightning page’s layout.

Page layouts are used to display the fields related to objects and allow you to enter data into those fields. This gives admins the flexibility to show different page layouts to different users based on profiles and/or record types...

Creating and using record types

Record types are the last piece of the puzzle. It is important to note that record types are not always needed; it depends on your business process. Record types are used when you need to show different page layouts, apply different processes, and/or need to show different picklist values based on a business use case. In this example, we will create two record types for the Certification object in order to show the correct picklist values in the Certification custom field. The record types will be Admin and Developer, and the goal is to show the admin certifications for Admin and the developer certifications for Developer. Let’s learn how to create these two record types and update the available picklist values.

First, navigate back to the Certification custom object, as shown in the following screenshot:

Graphical user interface, text, application  Description automatically generated

Figure 13.20: Option to create a new record type from the Details section of an object

Click on Record Types (1) | New (2...

Utilizing the created customizations

Now that we have created a custom object, created custom fields, created a page layout, and created record types, let’s put these customizations into practice! In the steps below, we will add a certification to a contact:

  1. Navigate to the Contacts tab (1), as shown in the following screenshot:
    Graphical user interface, application  Description automatically generated

    Figure 13.25: Navigating to the Certifications section of the page layout

    In the preceding screenshot, you can see that I navigated to the Brenda Mcclure contact (2) and scrolled down to the Certifications section. Click on New (3) to add a new certification.

  1. In the following screenshot, you can see the record type selection screen:
Graphical user interface, application  Description automatically generated

Figure 13.26: Adding the new certification by selecting one of the record types

  1. Select the Admin record type (1) and click on Next (2).

    In the following screenshot, you can see the Certification edit page:

    Graphical user interface, application  Description automatically generated

    Figure 13.27: New Certification...

Summary

In this chapter, we learned data modeling concepts and put these skills into practice by adding a certification to a contact. We learned how to add elements to a custom object, such as relationship fields that allow you to tie objects together. We also learned how to create page layouts and record types so that we can control how picklist values are displayed. With the skills you’ve learned in this chapter, you can extend Salesforce using clicks, not code to handle multiple use cases outside of standard objects.

In the next chapter, we will learn about Lightning Experience customization.

Adding a certification to a contact

Now that we have created a custom object, created custom fields, created a page layout, and created record types, let's learn how to add a Certification to a Contact:

  1. Navigate to the Contacts tab (1), as shown in the following screenshot:

In the preceding screenshot, you can see that I navigated to the Brenda Mcclure contact (2) and scrolled down to the Certifications section. Click on New (3) to add a new certification.

  1. In the following screenshot, you can see the record type selection screen:

  2. Select the Admin record type (1) and click on Next (2).

In the following screenshot, you can see the Certification edit page:

As shown in the preceding screenshot, I have filled out the certification fields and clicked Save.

In the following screenshot, you can see the newly created certification:

As shown in the preceding screenshot, the Admin certification has been created. Let's go over what we have learned in this chapter.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Salesforce for Beginners - Second Edition
Published in: Oct 2022Publisher: PacktISBN-13: 9781803239101
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (2)

author image
Sharif Shaalan

Sharif Shaalan was first introduced to Salesforce as an end user in 2007. His range of experience, from a sales rep to technical architect, helped him successfully lead more than 100 implementations including projects that were showcased on the main stage at Dreamforce. In 2013, Sharif was chosen as a Salesforce MVP, and in 2020 he was inducted into the Salesforce MVP Hall of Fame. Sharif is a regular speaker at Salesforce conferences and has obtained more than 10 Salesforce certifications. He is the founder and CEO of Agile Cloud Consulting and continues to be an active Salesforce community contributor
Read more about Sharif Shaalan

author image
Timothy Royer

Timothy Royer is the VP of Delivery at Agile Cloud Consulting and a Salesforce Certified Application Architect. Timothy began his Salesforce career in 2012 as an accidental administrator and has since participated in a number of implementations in a variety of roles. Timothy has experience as a Salesforce customer, a Salesforce partner, and as a member of the Salesforce.org professional services team.
Read more about Timothy Royer