+ Start a Discussion
naveen kunurunaveen kunuru 

junction object

wats is use of junction object ,why and when do we use it
Madhanprabhu Thangadurai 1Madhanprabhu Thangadurai 1
Hi Naveen,

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.

Fore more information, read this article http://www.jitendrazaa.com/blog/salesforce/deep-drive-in-junction-object-create-many-to-many-relationship-in-salesforce/
Arun ChaubeyArun Chaubey
Junction Object  -
A custom object with two master-detail relationships. Using a custom junction object, you can model a “many-to-many” relationship between two objects. For example, you may have a custom object called “Bug” that relates to the standard case object such that a bug could be related to multiple cases and a case could also be related to multiple bugs.Creating the many-to-many relationship consists of:Creating the junction object.
Creating the two master-detail relationships.
Customizing the related lists on the page layouts of the two master objects.
Customizing reports to maximize the effectiveness of the many-to-many relationship.

Creating the Junction Object - To create the junction object:From Setup, click Create | Objects.
Click New Custom Object.

In the custom object wizard, consider these tips specifically for junction objects:

Name the object with a label that indicates its purpose, such as BugCaseAssociation.
For the Record Name field, it is recommended that you use the auto-number data type.
Do not launch the custom tab wizard before clicking Save. Junction objects do not need a tab.
For more information, you can visit this link - https://help.salesforce.com/HTViewHelpDoc?id=relationships_manytomany.htm&language=en_US (https://help.salesforce.com/HTViewHelpDoc?id=relationships_manytomany.htm&language=en_US)

Kindly mark this answer as Best Answer if it helps you or serve your purpose in any way.

farukh sk hdfarukh sk hd