Junction object in Salesforce:
Let's say we have two objects Associate and Project and if we want number of associates to be mapped to a single project, So here we see under one project we will have multiple associates.In Salesforce we can achieve this by using lookup or master details relationship which are ONE-TO-MANY relationship.
But if we want one associate to work for multiple projects as well so here we will require MANY-TO-MANY relationship between Projects and Associates which can be achieved by having JUNCTION object in between the Project object and Associate object.The Junction object will have two master detail relationship one pointing to project and other pointing to Associate so as to map associate to more than one project and a Project to have multiple associates.
Let say If I have two custom objects obj1 and obj2, I will need obj3 as the junction object to create MANY-TO-MANY relationship between obj1 and obj2.
Image above shows fields on obj3 with two master detail relationship one pointing to obj1 and other pointing to obj2.
Let's say we have two objects Associate and Project and if we want number of associates to be mapped to a single project, So here we see under one project we will have multiple associates.In Salesforce we can achieve this by using lookup or master details relationship which are ONE-TO-MANY relationship.
But if we want one associate to work for multiple projects as well so here we will require MANY-TO-MANY relationship between Projects and Associates which can be achieved by having JUNCTION object in between the Project object and Associate object.The Junction object will have two master detail relationship one pointing to project and other pointing to Associate so as to map associate to more than one project and a Project to have multiple associates.
Let say If I have two custom objects obj1 and obj2, I will need obj3 as the junction object to create MANY-TO-MANY relationship between obj1 and obj2.
Image above shows fields on obj3 with two master detail relationship one pointing to obj1 and other pointing to obj2.
No comments:
Post a Comment