Lookup Relationships in Salesforce: A Complete Guide

When working with Salesforce, one of the most powerful ways to connect data across objects is through relationships. Just like in the real world, where people or things are connected to one another, Salesforce allows records in one object to be linked with records in another object.

One of the most commonly used relationships is the Lookup Relationship.


A Lookup Relationship is a type of relationship in Salesforce that links one object to another object (or itself).

It allows you to “look up” a related record and establish a connection between them. However, unlike Master-Detail Relationship, lookup relationships are loosely coupled.

👉 Think of it like this:

  • Lookup Relationship = A reference or optional link between records.
  • Master-Detail Relationship = A strong dependency between records.

  1. Optional Relationship – A record in one object can exist without a related record in the other object.
  2. No Cascade Delete (by default) – Deleting the parent record does not automatically delete child records.
  3. Flexibility – Can be used to link standard-to-standard, standard-to-custom, or custom-to-custom objects.
  4. Up to 40 Lookup Fields – You can create up to 40 lookup fields per object.
  5. Self-Relationship – An object can have a lookup relationship with itself (e.g., Employee Manager hierarchy).

Imagine you are managing a Student Management System in Salesforce.

  • You have a Student object.
  • You also have a Course object.

Using a Lookup Relationship, you can link each Student to the Course they are enrolled in.

But the student can exist in the system even without being enrolled in any course (that’s why the relationship is not mandatory).


Here’s a simple visualization:

[ Student Object ]   <---- Lookup ---->   [ Course Object ]

    (Child)                                  (Parent)

In Salesforce UI, the Student record will have a lookup field that lets you select a Course.


👉 The Course (Lookup field) in the Student object points to a record in the Course object.


FeatureLookup RelationshipMaster-Detail Relationship
DependencyLooseStrong
Record OwnershipIndependentControlled by Parent
Delete BehaviorChild survivesChild deleted with Parent
Roll-up Summary FieldsNot SupportedSupported
Mandatory RelationshipOptionalMandatory

  1. Self-Lookup
    • An object can look up to itself.
    • Example: An Employee record having a lookup field for their Manager (who is also an Employee).
  2. Hierarchical Lookup
    • Specially available only for the User object.
    • Allows one User to be linked hierarchically to another User (e.g., manager-subordinate relationship).

  1. Go to SetupObject Manager → Select your Object (e.g., Student).
  2. Click Fields & RelationshipsNew.
  3. Choose Lookup Relationship.
  4. Select the related object (e.g., Course).
  5. Set field-level security and layout.
  6. Save and test by creating records.

Use a Lookup Relationship when:

  • The child record should exist independently of the parent.
  • You don’t want cascade delete behavior.
  • You don’t need roll-up summary fields.
  • The relationship is more about referencing rather than dependency.

  • Can be optional.
  • Can link objects flexibly.
  • No roll-up summary fields.
  • No cascade delete (unless enabled).
  • Supports up to 40 lookups per object.
  • Useful for real-world reference-like relationships.

Lookup Relationships in Salesforce provide flexibility and independence between records. They are ideal when you need to reference another object but don’t want strong dependency.

Whether you’re linking Students to Courses, Employees to Managers, or Accounts to Contacts, lookup relationships make your Salesforce data model more powerful and interconnected.


Leave a Reply

Your email address will not be published. Required fields are marked *