Activity Forums Salesforce® Discussions Explain use of Junction Object in Salesforce.

  • shradha jain

    Member
    August 7, 2018 at 6:32 am

    Hello Madhulika,

    Junction Object is 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 create 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:

    1. Creating the junction object.
    2. Creating the two master-detail relationships.
    3. Customizing the related lists on the page layouts of the two master objects.
    4. Customizing reports to maximize the effectiveness of the many-to-many relationship.

    You can refer the following link :

    https://help.salesforce.com/articleView?id=relationships_manytomany.htm&type=5

    Thanks.

  • Anjali

    Member
    September 5, 2018 at 5:43 am

    Hello Madhulika,

    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 two.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.

    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.

  • shariq

    Member
    September 17, 2018 at 9:13 pm

    Hi,

    To be more clear -

    You can only create many to many relationship between two objects through third one which is called Junction Object.

    Like many products have multiple prices and same price is on multiple products.

    Hope this helps.

  • Parul

    Member
    September 18, 2018 at 4:29 am

    Hi

    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.

    Hope this will help you.

    Thanks

  • Aman

    Member
    September 29, 2018 at 7:20 pm

    Hi,

    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.

    Thanks

  • Avnish Yadav

    Member
    September 29, 2018 at 8:03 pm

    Hello,

    junction object is a custom object with two master-detail relationships and is the key to making a many-to-many relationship.

    Thanks.

  • Prachi

    Member
    October 15, 2018 at 1:01 pm

    hi,

    Junction objects are used to create many to many relationships between objects. It is a custom object which can link one instance of a record to many children, and each child can equally be linked too. Junction Object have two master-detail relationships to two different record types.

  • Prachi

    Member
    November 13, 2018 at 12:41 pm

    Hello Madhulika,

    Junction Object is 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 create 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.

  • William

    Member
    December 10, 2018 at 3:55 am

    In salesforce junction object is a custom object which uses one instance of a record to many child records. 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.

Log In to reply.

Popular Salesforce Blogs