function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rahul Sharma 364Rahul Sharma 364 

how to decide which relationship to be created between two objects ?

Amit Chaudhary 8Amit Chaudhary 8

Loookup :                                                                    Master :

Loosely coupled                                                          Tightly coupled
Max number of lookup is 25                                         Max number of master is 2
Not a mandatory                                                          Mandatory
Once value is assigned can be changed                    Cannot be changed
Partent delete child cannot delete                              parent delete child also delete
cannot on lookup                                                        Roll up can be made on master-detail

Create Object Relationships (https://trailhead.salesforce.com/en/modules/data_modeling/units/object_relationships)

The Wide World of Object Relationships
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.

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

Let us know if this will help you