DATA MODELING

INTRODUCTION

Data modeling is the process of creating a visual representation of either a whole information system or parts of it to communicate connections between data points and structures. Simply it’s a way to model what database tables look like in a way that makes sense to humans. Salesforce Data Model is essentially the manner in which tables of data are represented within your Salesforce database to make them understandable to anyone who views them. Data modeling helps you make sense of the data residing within our system. In Salesforce, we think about database tables as objects, columns as fields, and rows as records. For example, the data about the configuration and settings of an account are already in-built as a relational table. But you can also create your own tables to store data specific to your business like the 'dispatch schedule' for a week assuming you are a courier company.

Enquiry Now

In this module, we focus on the two most common types of objects:
1.Standoard Object
2.Custom Object

1.1.STANDARD OBJECT

The objects already created for you by the Salesforce platform to manage the configurations and settings of the environment. Once you log in to the salesforce platform, you can see the available objects.
Example: The most commonly referred standard object is called the Account Object. It is the object which stores the preliminary information about a customer, partner, competitor or another organization. We can explore the account object by following the steps below.
Step 1:
Login to the Salesforce platform and follow the link path Settings → Setup Home → Object Manager - Account.

Step 2:
In this step, click on the Schema Builder. It shows the complete Account table with field names and data types. There are fields marked red. The fields marked red indicate that it is mandatory to fill the fields when an account is created.

CUSTOM OBJECT

These are the objects created by us based on our business processes.
Implementation of custom object:
Click the Object Manager tab.
Click Create then Object in the top-right corner.
Enter values for label and plural label
Check the box for Launch New Custom Tab Wizard after saving this custom object.
Leave the rest of the values as default and click Save.

OBJECT RELATIONSHIPS

There are two main types of object relationships: lookup and master-detail.

CREATE A LOOKUP RELATIONSHIP

A Lookup relationship involves finding value of a field based on the value in another field in another object. It is mostly used in the case of commonly shared data between two objects.
1.From Setup, go to Object Manager | DeliveryLocation
2.On the sidebar, click Fields & Relationships.
3.Click New.
4.Choose Lookup Relationship and click Next.
5.For Related To, choose DeliverySchedule.
6.Click Next.
7.For Field Name, enter DeliverySchedule, then click Next.
8.Click Next, Next, and Save.

You can verify the lookup relationship created by going to the schema builder and choosing the two objects for display.

CREATE A MASTER-DETAIL RELATIONSHIP

The Master Detail relationship is used when we want to control the display of detail records based on the value in the master record. For example, in the courier company model a delivery schedule is always linked to a delivery location. If we remove a delivery location from our list, then all the related delivery schedules should also be eliminated.
1. On the Object Manager page for the custom object, click Fields & Relationships.
2. Click New.
3. Select Master-Detail Relationship and click Next.
4. For Related To, choose DeliverySchedule.
5. Click Next.
6. For Field Name, enter DeliverySchedule and click Next.
7. Click Next, Next, and Save.