Junction Object in Salesforce : Amit Chaudhary

Junction Object in Salesforce
by: Amit Chaudhary
blow post content copied from  Apex Hours
click here to view original post


A junction object is a Salesforce object that contains many-to-many relationships between two related objects.

What is a Junction Object in Salesforce?

If you want to create the many-to-many relation then we need to use the Junction object in Salesforce. A junction Object is a type of custom object which allows linking two custom objects.

A junction Object in simple terms can be called a custom object with two master details fields

Junction Object Examples

For example, Let us assume that we have two Objects – Contact and Room. To provide the many-to-many relationship between the Contact and the Room, we will need to create one more object let’s say it would be Reservation, it will be called a junction object.

Junction Object Examples

Relationship Types in Salesforce

Let’s see how many types of relationship type in Salesforce.

  1. Master-Detail Relationship: One Object is considered as the Master and the other as the Detail. If you delete the record of the Master Object, the information of the Detail Object will get deleted automatically.
  2. Look-Up Relationship: The Objects in a Look-Up Relationship are connected loosely. It means that if you delete the record of an Object, it will not impact the linked Object.
  3. Many-to-Many Relationship: Records of a particular object can connect with various records of different objects and vice versa.
  4. Self Relationship: It means an Object is creating a relationship with itself. 
  5. External Relationship: This field is used to connect the external Object with another external object. 

Steps to create a Junction Object in Salesforce

Check the below session from min 46:00 to learn about junction objects.

Junction Object Interview Question

Try below and find the answer to the Junction Object Interview Question. Don’t forget to share the answers in comment

  1. As a user, you will able to see junction records in Salesforce when you don’t have read access on one parent record.
  2. What happened to the junction record when someone deleted the one-parent record?

The post Junction Object in Salesforce appeared first on Apex Hours.


December 19, 2022 at 07:30PM
Click here for more details...

=============================
The original post is available in Apex Hours by Amit Chaudhary
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================

Salesforce