Junction Objects

Introducing Junction Objects in Salesforce

A Junction is an object which is utilized to combine two master-detail relationships. In a layman’s dialect, when two relationships come together, they shape one relationship out of the two.

Case 1: One to Many Relationships

Case 2: Many to One Relationship

Result: Many to Many Relationships

Junction objects are utilized for making many-to-many relationships in Salesforce. Salesforce by default supports one-to-many connections. These are the Master-Detail, the Lookup, and the Outside Lookup relationships. They are characterized by the many-to-one side, meaning from a child to a parent. These relationships can be changed to one-to-one relationships. The way to do typically through an expansion of validation rules, or by utilizing triggers to actualize the one-to-one sort. This implies as if one child is permitted for one parent.

dont miss out iconDon't forget to check out: Deploying Process Builder Through Change Set | Salesforce Developer Guide

How To Make Many-to-Many Relationship

Junction objects are valuable for making different relationships over things beneath two objects. Take the Selecting application for instance. Here, you see that a certain position can be connected to many applicants. Presently, with the use of a junction object, you'll connect each applicant to diverse positions accessible in your company. In this show, the junction object (Work Application, for illustration) capacities as the linkage between the objects Applicant and Position. To actualize this many-to-many relationship, make a lookup field for both Candidate and Position on the Job Application object.

So Here Are The Steps: 

  • Create the junction object – You would like to customize an object so that it can afterward be utilized as the junction object. Steps in customizing a protest, for this reason, vary from version to edition.
  • Create two master-detail relationships – You wish to confirm, to begin within case the objects to be related as of now exist. 

Use of Junction Object It is the foremost common question which is inquired within the meet with Salesforce candidates. It may be a custom question which is utilized to connect one model of a record to numerous child records and numerous child records to on records equally. Cases are as of now said over. Presently, we'll learn step by step procedure to make a Junction object for Numerous to Numerous connections in Salesforce. To make Numerous to Numerous relationships, at first, we ought to make a Junction object.

dont miss out iconCheck out another amazing blog by Ayush here: Aggregate Functions in Salesforce - The Developer Guide

Things To Remember

There is as it were one Master-detail relationship per object: 

  • If record A is erased, at that point child record related to it, that's record C will moreover be deleted.
  • If record B is erased, at that point child record with this record, that's record C will moreover be deleted But on the off chance that record C is erased, as it were C will be erased; the ace record will not be erased and stay same.
  • If child C has two aces- record A and B, where A is an essential connection at that point child record C will acquire the see and feel of parent question A.


Popular Salesforce Blogs