Professional Documents
Culture Documents
2.2 Data Modeling and Management Relationship Types
2.2 Data Modeling and Management Relationship Types
• Without relationships, you could build out as many custom objects as you can think of, but they'd have no way of
linking to one another.
• With relationships, you can display data about other related object records on a particular record's detail page.
• Husband / Wife
• Team / Player
Many to One:
• Player / Team
• Subject / Student
• Book / Bookstore
Book Bookstore Many-to-Many
• Lookup: appropriate when a relationship between two objects is Opportunity is the child of Account
not tight,
Account is the Parent of Opportunity
• Master-Detail: appropriate when a relationship between two
objects is tight, Relationship Field is on the Child Object on
Opportunity!
To relate 2 Objects via a One-to-Many Relationship, you should always
create the Relationship Field on the child Object (the “Many” side
Object).
• This creates a relationship that links one object to another • This creates a relationship that links one object to another
object object
• Record Deletion is independent • When you delete the master record, all of its detail records
are automatically deleted along with it
• Lookup fields can be optionally required on child records.
• Master-detail relationship fields are always required on detail
records.
• A junction object is a custom object that is Child to both Objects via 2 Master-Detail relationships
• To create a many-to-many relationship, you first create the Junction Object, then create the 2 Master-Detail
relationships for it
• Book / Bookstore
Book Bookstore Book Selling Bookstore
• External Lookup:
• The standard External ID field on the parent external object is matched against the values of the child’s external lookup
relationship field.
• Indirect Lookup
Publisher
Selling
Bookstore
12
The “Books Cloud” App
13
Summary
In this chapter, you have learned:
14
Relationship Types
15