Object Relationships in Salesforce

Every object in Salesforce can connect with another object. They have a property known as object relationships. In this post, you will learn more about object relationships – its definition, uses and types.

What is Object Relationship?

Object relationship refers to the linkages that an object exhibits with another object. This is a two-way association between Salesforce objects. Relationships help put together objects that can be in line with one another.

Why Use Relationships?

Relationships are defined so that related data stored in various objects can easily be linked for easier access and identification. For instance, linking a Credit Card Number field object with its corresponding Account User field object ensures better data integrity while keeping business processes streamlined and clear.

Types of Relationships

There are three main relationship types recognized by the Salesforce platform:

1. Master-Detail

This type of object relationship functions on a parent-child premise. The master object exerts control over the behaviors of the detail object. In other words, the direct object becomes dependent on the master object.

Key Points:

Master object and detail object share the same settings for security and sharing.
The detail object’s owner field is automatically set to reflect that of the master records.
If a master object gets deleted, all associated detail objects get deleted as well.
The relationship type cannot use re-parenting as set by default. However, administrators can choose to allow re-parenting of a child record’s custom objects to a different parent record by enabling the Allow Parenting option in the relationship definition.

2. Lookup

The Lookup relationship type associates two objects with each other with no effect on their security and deletion.
Key Points:

Child record doesn’t get affected if ever the parent record is deleted.
The related objects do not share the same security settings.
Deleting a parent record will not automatically delete the child record.
An object can have a maximum of 25 lookup relationships.

3. Many-to-Many

In this relationship, one object record can link to several object records and vice versa. Defining such a relationship requires the creation of a custom function object, which links to other objects via the Master-Detail relationship.

Key Points:

A parent field is required for the child field.
Many-to-Many limits the access of child records to the access of the parent record.
Deletion of parent record likewise affects the child record.

Summary

Object relationships define association between different records, fields and objects. There are three types of relationships – Master-Detail, Lookup, and many-to-Many. Each has their similarities and differences, but then they all function to interlace related data cleanly and easily.

Share this article!

Partager sur facebook
Partager sur twitter
Partager sur linkedin
Partager sur email