Activity › Forums › Salesforce® Discussions › Can we create many to many relationship using lookup field in Salesforce Junction Object?
Tagged: Cascade Delete, Child Record, Difference, Junction Object, Lookup Field, Many To Many Relationships, Master Detail Relationship, OWD, Salesforce.com
-
Can we create many to many relationship using lookup field in Salesforce Junction Object?
Posted by shariq on July 4, 2017 at 10:39 PMIn Salesforce, can we create many to many relationship using lookup field in junction object?
Avnish Yadav replied 7 years, 7 months ago 6 Members · 8 Replies -
8 Replies
-
Yes you can.. but there will be difference in terms of what you achieve thru master-detail.
- [adinserter block='9']
-
Differences like in case of lookup:
1.The child record could exist independently.
2. No cascade delete.
3. Independent OWD/Ownership
-
Hello Shariq,
When you first learned that every record in Salesforce has a designated owner, you might have been a little surprised. In most database-driven applications and platforms, access to data isn’t tied to any ”’ownership” concept.
Record ownership is at the core of Salesforce’s record access capabilities, which allow you to specify which users or types of users should be able to access specific records or types of records. Salesforce.com’s architects and developers have spent years creating a highly functional and massively scalable record access infrastructure around record ownership, saving you the monumental effort of building that infrastructure yourself.
-
Yes, you can use Lookup Relationship for creating a Many-To-Many relationship, but, it will not support entire feature of Many-To-Many concept. In other words, using Master-Detail Relationship for creating Many-To-Many Relationship gives you an ideal feature of Many-To-Many. Here are the features which you will not get with lookup relationship.
If these features are not required or adjusted somehow by your custom code, then both options will work. But, Master-Detail solution is always the ideal solution.
Thanks
-
Hi,
Creating Many to Many relationship in salesforce is little tricky. You cannot create this type of relationship directly. Follow below steps to create this type of relationship.
Create both objects which should be interlinked.
Create one custom object (also called as junction object), which should have auto number as unique identification and create two master relationships for both objects, no need create tab for this object.
Now on both objects, add this field as related list.Thanks
-
Hello,
You can use Junction Object to create many to many relationships.
thanks.
Log In to reply.