Data Modeling in Salesforce

This is a CheatSheet for Salesforce data modeling, summarized from Data Modeling Module.

Photo by Mika Baumeister on Unsplash

Objects

Object means table or spreadsheet in Salesforce. It supports following different types of objects.

  • standard objects
  • custom objects
  • external objects
  • platform events
  • BigObjects

Create custom Objects

In Setup, Object Manager tab:
1. Click Create -> Custom Object in the top-right corner.
2. Fill out the Label (Object Name and Record Name fields auto-fill)
3. Fill out the Plural Label of the label name
4. Select the checkbox: Launch New Custom Tab Wizard after saving this custom object. (Or you can launch later: Setup -> Tabs -> Custom Object tabs -> Click on New button), click Save
6. Click the Tab Style field and select a icon you like
7. Click Next, Next, and Save.

Add Fields to the Object (Fields mean columns for the table)

In Setup, Object Manager tab:
1. Click the Object you want to add filed to
2. In the sidebar, click Fields & Relationships
3. Click New in the top right
4. Select data type of the field, click Next
5. Fill out the Field Label and Description
6. Check the Required box, if the field is required for every records
7. Click Next, Next again, and then Save

Create Records (Records mean rows for the table)

In the Object tab:
1. Click New in the top corner
2. Enter the required fields for the Object and click Save

Object Relationships

  • There are two main types of object relationships: lookup and master-detail.
  • Master-detail relationships are a bit tighter than lookup relationships. In master-detail relationship, one object is the master and another is the detail.

Create a Relationship

In Setup, Object Manager tab:
1. Click the Object you want to add relationships to
2. In the sidebar, click Fields & Relationships
3. Click New, choose Lookup Relationship/Master-Detail Relationship, and click Next
4. For Related To: another Object and click Next
5. Notice that the Field Label and Field Name fields auto-fill, Next
6. Click Next, Next, and Save

Schema Builder

  • Schema Builder is a tool that lets you visualize and edit your data model. You can also create objects and fields using Schema Builder.

Create an Object with Schema Builder

1. In the left sidebar, click the Elements tab
2. Drag Object onto the canvas
3. Enter information about your object and Save

Create Fields with Schema Builder (You can create relationship fields, formula fields, and normal fields in Schema Builder.)

In Setup|Home, find Schema Builder:
1. In the left sidebar, click the Elements tab
2. Choose a field type and drag it onto the object you want
3. Fill out the details about your new field and Save

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store