Object Relationships
Relationships are a key part of developing a flexible and scalable schema. Early decisions about a data model can have a significant impact on the flexibility and scalability of the system in the future, potentially causing significant problems if not considered carefully.
Choosing the right relationship
| Problem | Relationship to use | Notes |
|---|---|---|
| One record relates to another | Lookup | |
| One record has many related records | Lookup | One-to-many relationship |
| One record tightly relates to another, would not exist without its parent | Master-Detail | Consider sharing implications |
| One record could be related to many others, and those records could be related to many | Junction/Join | |
| Record belongs in a hierarchy of sibling records | Lookup (self-reference) | |
| One record is related to exactly one record in a different object | Lookup (One-to-one) | Requires automation to enforce |
| One record is related to many records in a different object | Lookup | One-to-many relationship |
tip
When in doubt, a Lookup relationship is usually the correct choice.