• WHO WE ARE
  • WHAT WE DO
    • Salesforce
      • Implementations
        • Sales Cloud
        • Service Cloud
        • CPQ
        • Field Service Lightning
        • Field Service for SMEs
      • Developments
        • Salesforce Customization
        • Custom Application Development
        • AppExchange Product Development
      • Migrations
        • Classic to Lightning Migration
        • Other Systems to Salesforce Migration
      • Integrations
    • Data Science
      • BI Solutions
      • AI/ML solutions
      • Agentic AI
  • HOW WE DO
    • Delivery Model
    • Our Works
  • REACH US
    • Contact Us
    • Careers
  • BLOG
    • WHO WE ARE
    • WHAT WE DO
      • Salesforce
        • Implementations
          • Sales Cloud
          • Service Cloud
          • CPQ
          • Field Service Lightning
          • Field Service for SMEs
        • Developments
          • Salesforce Customization
          • Custom Application Development
          • AppExchange Product Development
        • Migrations
          • Classic to Lightning Migration
          • Other Systems to Salesforce Migration
        • Integrations
      • Data Science
        • BI Solutions
        • AI/ML solutions
        • Agentic AI
    • HOW WE DO
      • Delivery Model
      • Our Works
    • REACH US
      • Contact Us
      • Careers
    • BLOG
  • [email protected]
  • (+91) 44-49521562
Merfantz - Salesforce Solutions for SMEs
Merfantz - Salesforce Solutions for SMEs
  • WHO WE ARE
  • WHAT WE DO
    • Salesforce
      • Implementations
        • Sales Cloud
        • Service Cloud
        • CPQ
        • Field Service Lightning
        • Field Service for SMEs
      • Developments
        • Salesforce Customization
        • Custom Application Development
        • AppExchange Product Development
      • Migrations
        • Classic to Lightning Migration
        • Other Systems to Salesforce Migration
      • Integrations
    • Data Science
      • BI Solutions
      • AI/ML solutions
      • Agentic AI
  • HOW WE DO
    • Delivery Model
    • Our Works
  • REACH US
    • Contact Us
    • Careers
  • BLOG

Part I – 3.How to Create Object Relationship in Salesforce

  • November 2, 2017
  • Merfantz Editor
  • Salesfore Training Course, SFDC Training Part I
  • 0

Object relationships are a special field type that connects two objects together.Let’s think about a standard object like Account. If a sales rep opens an account, they’ve probably been talking to a few people at that account’s company.

They’ve probably made contacts like executives or IT managers and stored those contacts’ information in Salesforce. It makes sense, then, that there should be a relationship between the Account object and the Contact object. And there is!

When you look at an account record in Salesforce, you can see that there’s a section for contacts on the Related tab. You can also see that there’s a button that lets you quickly add a contact to an account.

The Account to Contact relationship is an example of a standard relationship in Salesforce. But just like objects and fields, you can build custom relationships as well.

The different kinds of relationships you can create in Salesforce. There are two main types of object relationships: lookup and master-detail.

Lookup Relationships

In our Account to Contact example above, the relationship between the two objects is a lookup relationship. A lookup relationship essentially links two objects together so that you can “look up” one object from the related items on another object.

Lookup relationships can be one-to-one or one-to-many. The Account to Contact relationship is one-to-many because a single account can have many related contacts. For our DreamHouse scenario, you could create a one-to-one relationship between the Property object and a Home Seller object.

One to Many relationship Sample Diagram

Master-Detail Relationships

While lookup relationships are fairly casual, master-detail relationships are a bit tighter. In this type of relationship, one object is the master and another is the detail. The master object controls certain behaviors of the detail object, like who can view the detail’s data.

For example, let’s say the owner of a property wanted to take their home off the market. DreamHouse wouldn’t want to keep any offers made on that property. With a master-detail relationship between Property and Offer, you can delete the property and all its associated offers from your system.

Master-detail relationships can be used to model many-to-many relationships between any two objects. A many-to-many relationship allows each record of one object to be linked to multiple records from another object and vice versa.

A sample diagram of Many-to-Many Relationship

Create a lookup relationship

To start, create a custom object called Favorite with an Auto-Numbered name field. If you need a reminder on how to create objects, check the previous unit.

We’re going to create two custom relationship fields on the Favorite object. First, let’s create a lookup relationship that lists the users who favorite a property.

  1. From Setup, go to Object Manager | Favorite.
  2. On the sidebar, click Fields & Relationships.
  3. Click New.
  4. Choose Lookup Relationship and click Next.
  5. For Related To, choose Contact. For the purposes of DreamHouse, contacts represent potential home buyers.
  6. Click Next.
  7. For Field Name, enter Contact and click Next.
  8. Click Next, Next, and Save & New.

Create a Master-Detail Relationship

Now, we’re going to create a second relationship field. We want a master-detail relationship where Property is the master and Favorite is the detail.

  1. Choose Master-Detail Relationship and click Next.
  2. For Related To, choose Property.
  3. Click Next.
  4. For Field Name, enter Property and click Next.
  5. Click Next, Next, and Save.

Great job! Our Favorite object is all set up. Now, if you look at a Property or Contact record, you’ll see that there’s a Favorites section in the related tab.

This Training blog is very useful to you to learn about object relationship.

Author Bio

Merfantz Editor
+ Recent Posts
  • August 4, 2023
    How to Setup CRM Analytics for Financial Services Cloud
  • August 2, 2023
    How to Get Started with Salesforce Hyperforce - Merfantz
  • July 28, 2023
    Health Cloud Mastery: Salesforce Trailhead for Effective Healthcare CRM
  • July 26, 2023
    How to integrate Data cloud and Marketing cloud In Salesforce
  • Previous Part I – 2.Use of Formula Field and Map Fields in Salesforce
  • Next Part I – 4.How to Create Junction Object in Salesforce
Merfantz Technologies is a leading Salesforce consulting firm dedicated to helping small and medium enterprises transform their operations and achieve their goals through the use of the Salesforce platform. Contact us today to learn more about our services and how we can help your business thrive.

Discover More

Terms and Conditions
Privacy Policy
Cancellation & Refund Policy

Contact Info

  • No 96, 2nd Floor, Greeta Tech Park, VSI Industrial Estate, Perungudi, Chennai 600 096, Tamil Nadu, INDIA
  • (+91) 44-49521562
  • [email protected]
  • 9:30 IST - 18:30 IST

Latest Posts

Unlocking the Power of Dynamic Forms in Salesforce Lightning App Builder
Unlocking the Power of Dynamic Forms in Salesforce Lightning App Builder May 29, 2025
Einstein Activity Capture Boosting Productivity & Relationship Intelligence
Einstein Activity Capture: Boosting Productivity & Relationship Intelligence May 22, 2025
Let Einstein Help You Build - Salesforce Flow
Let Einstein Help You Build – Salesforce Flow May 15, 2025

Copyright @2023 Merfantz Technologies, All rights reserved