function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RakeyshRakeysh 

junction object

Hi

 

can you explain juction object with an example other than standard caseobject  & bug (custom object) example

Rajesh SriramuluRajesh Sriramulu

Hi

 

Juction object is mainly used in many to many relatioship and  that join one object to another and   to join many objects on one side to many on the other.

 

 

for eg :if you have a Contact, it can be attached to many Campaigns. So you might expect a campaign list as a related list on the Contact detail page. But equally, a campaign can cover many contacts.

 

Regards

SRS

sfcksfck

Teacher and student. Each teacher has many students and each student has many teachers. In salesforce, you could put a teacher lookup field on student, but then each student will only have one teacher. Or you could do it the other way round but then each teacher could only have one student. Neither will work.

 

So what you do is create a Teacher_Student object (this is the junction object). Each Teacher_Student record joins one teacher to one student, but you can have as many combinations as you like. You achieve this by putting two lookup fields on the Teacher_Student object - a Teacher lookup field and a Student lookup field.

 

E.g. Dr Jones has two students - Alice and Bob. So you make two Teacher_student objects, one connecting Dr Jones to Alice, and one connecting Dr Jones to  Bob. If Bob has another teacher too, called Prof Smith, you just make another Teacher_Student object, connectiong Prof Smith to Bob. 

 

priyanka.mv26priyanka.mv26

Hi,

 

Junction object is nothing but the concept of multiple inheritance in oops. Object used for creating many-to-many(m-m) relationship between 2 objects. Junction object will have 2 master-detail fields

 

Let me assume 3 objects Position,Candidate and job application. In this the Job application is the child of two parent objects Position and Candidate. So the Job application object is known as junction object.

 

Thanks,

Priya