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
naveen kumar 657naveen kumar 657 

what is difference b/n one to many ,one to many and junction object . bcz using lookup relation we can get many to many behaviour then what is special future junction object have ?

Hi Gurus ,
what is difference b/n one to many  ,one to many and junction object . bcz using  lookup relation  we can get many to many behaviour then what is special future junction object have ? Means creating lookup fields in both object we can get the many to many behaviour than what is need of creating  junction object ? than you in advance .
Thanks
Naveen k.
Best Answer chosen by naveen kumar 657
Amit Chaudhary 8Amit Chaudhary 8

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.
 

For jucntion object please check below post
1) https://www.jitendrazaa.com/blog/salesforce/deep-drive-in-junction-object-create-many-to-many-relationship-in-salesforce/

Let us know if this will help you or you need more help
 

All Answers

Amit Chaudhary 8Amit Chaudhary 8

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.
 

For jucntion object please check below post
1) https://www.jitendrazaa.com/blog/salesforce/deep-drive-in-junction-object-create-many-to-many-relationship-in-salesforce/

Let us know if this will help you or you need more help
 
This was selected as the best answer
naveen kumar 657naveen kumar 657
Thanks for clear explaination .
Raghuram KuthuruRaghuram Kuthuru
Thank you Amit