Skip to main content

Lookup

Lookups are the most common type of relationship in Salesforce, and are used to link two objects together. They are used whenever one record needs to reference another record, and are the most flexible type of relationship within Salesforce. They can create a wide variety of different relationship types, depending on the requirements and how they're set up.

One-to-many relationships

The most prolific type of lookup relationship is where one record can have many children. For example, an Account record can have many Contact records associated with it. The lookup field is located on the child records and points to the parent record.

info

These types of relationships are usually optional.

One-to-one relationships

Sometimes a relationship is required that links one record to another and there can only be one record on either end of the relationship. This is known as a one-to-one relationship. Lookup relationships are the best way to achieve this, with a lookup field on each object pointing to the other.

tip

Use automations and validations to enforce the integrity of relationships.

Self-referencing lookups

Lookups can also be used to reference the same object, creating a self-referential lookup. For example, the Parent lookup on the Account object can be used to reference another Account record. This is useful when you want to create a hierarchy of records, such as a parent-child relationship between accounts, or linking a Client Contact contact record to a Candidate contact record for the same person.

note

A record cannot relate to itself.