Data Modeling

Understand Custom & Standard Objects

Describe the perks of using objects on the Salesforce platform. Explain the difference between standard objects and custom objects. List the types of custom fields an object can have.
  • Data Model: way to model what database tables look like in a way that makes sense to humans. When we talk about the data model, we’re talking about the collection of objects and fields in an app.
    • Objects: database tables, containers for information
    • Fields: columns
    • Records: rows
  • Several types of objects: standard objects, custom objects, external objects, platform events, and BigObjects.
    • Standard Objects: included with Salesforce, include Account, Contact, Lead, Opportunity, etc.
    • Custom Objects: objects created to store information specific to your company/industry.
  • Every standard and custom object has fields attached to it. Here are the types of fields:
    • Identity: An account ID looks like 0015000000Gv7qJ
    • System: CreatedDate, LastModifiedById, and LastModifiedDate
    • Name: A contact’s name can be Julie Bean A support case’s name can be CA-1024
    • Custom: Contacts can have birthdays added
  • Every field has a data type:
    • Checkbox
    • Date or DateTime
    • Formula: automatically calculated based on a written formula
  • Customization Best Practices:
    • Be thoughtful about names: Give your objects and fields descriptive, unique names to improve clarity.
    • Help out your users: Include descriptions for your custom objects and fields.
    • Require fields when necessary: make fields required in the forms that users use to create new records.

Create Object Relationships

Define the different types of object relationships and their typical use cases. Create or modify a lookup relationship. Create or modify a master-detail relationship.
  • Object relationships are a special field type that connects two objects.
  • Two main types of object relationships:
    • Lookup: essentially links two objects together so you can “look up” one object from related items on another object. One-to-one or one-to-many. Ex: a single account can have many related contacts.
      • Used when objects are only related in some cases. Sometimes a contact is associated with a specific account, but sometimes its just a contact.
    • Master-Detail Relationships: tighter than a lookup relationship. Assume the owner of a property wanted to take their home off the market. Deleting the property would also delete all its associated offers from the system.
      • Detail object doesn’t work as a stand-alone
  • A third relationship is hierarchical relationships which are only available on the User object. These are used to create management chains, for example.
  • Create and modify relationships: Setup » Object Manager » Fields & Relationships

Work with Schema Builder

Describe the advantages of using Schema Builder for data modeling. Use Schema Builder to create a schema for a given object model. Use Schema Builder to add a custom object to your schema. Use Schema Builder to add a custom field to your schema.
  • Schema builder is a useful tool for designing and understanding complex data models.
  • Access Schema Builder via Setup » Quick Find » “schema builder”