Activity › Forums › Salesforce® Discussions › What is a junction object and what is its use in Salesforce?
Tagged: Job Application Object, Junction Object, Master Detail, Salesforce Relationships, Trigger, Validation Rules
-
What is a junction object and what is its use in Salesforce?
Posted by Achintya on September 5, 2019 at 5:26 AMWhat is a junction object and what is its use in Salesforce?
Deepak replied 6 years, 8 months ago 3 Members · 2 Replies -
2 Replies
-
Hi,
If you require to implement many to many relationship in salesforce, you need to use Junction object.
- [adinserter block='9']
-
Salesforce supports 2 kinds of relationships like Master Detail and Lookup. They are both one-to-many relationship, and they are both defined from the many-to-one side, that is from a child to a parent. They can be made one-to-one relationship by adding validation rules, or maybe triggers to enforce the one-to-one nature, i.e. only one child is allowed.
Junction objects are used to create many to many relationships between objects. If you take the Recruiting application example, you can see that a Position can be linked to many Candidates, and a Candidate can apply for different Positions. To create this data model you need a third object “Job Application” that links the 2.
So you’d create a lookup field for both Position and Candidate object on the “Job Application” object. This will establish many to many relationship between Position and Candidate via the “Job Application” object known as the junction object.
Log In to reply.