1. Lookup Relationships
2. Master-Detail Relationship
3. Many-to-Many Relationships
4. Self-Relationship
1. Lookup Relationships
2. Master-Detail Relationship
Both objects are weakly connected in this case, which implies that if one is destroyed, the other will not be deleted.
When a child record is deleted and then restored from the recycle bin, the master-detail relationship is lost at the time of deletion and is not restored once the child/detail is restored. We can convert a master-detail to a look-up if the lookup field in all records has a value, and we can convert a look-up to a master detail if there is no roll-up summary field available.
1. From Setup, go to Object Manager | Favorite.
2. Select Fields & Relationships from the sidebar.
3. Click New.
4. Choose Lookup Relationship and click Next.
5. For Related To, choose Contact. …
6. Click Next.
7. For Field Name, enter Contact, then click Next.
8. Click Next, Next, and Save.
In this type of relationship, one object acts as a master and the other acts as a detail object. In other words, this relationship is similar to that of a parent and a child. When we want two objects to be strongly tied or dependent on each other, we utilize this form of relationship.
1. Click Fields & Relationships on the custom object’s Object Manager page.
2. Click New.
3. Select Master-Detail Relationship and click Next.
4. For Related To, choose Property.
5. Click Next.
6. Enter Property as the Field Name and then click Next.
7. Click Next, Next, and Save.