
Hi Salesforce Community,
I have a small issue. I designed two objects (A & B for simplicity purpose), and made a simple Lookup field on one of the objects to look up the other. Currently it works 1:n. It worked great where object A had a related list of all records from object B.
I just ran into a situation where I will need to make it many-to-many as one record in a object "B" can relate to multiple records of object "A".
I found this article about junctions, but I don't fully understand if this will do the trick. https://help.salesforce.com/HTViewHelpDoc?id=relationships_manytomany.htm&language=en_US
Is there a way for me to keep the objects and related records, and add the functionality of having many to many relationship on them?
Thank you!
Max
2 risposte
You will need to use a junction object in order to create a many-to-many relationship. Think of a junction object this way....
Each junction object will have a 1-1 relationship with A, and a 1-1 relationship with B. However, since each junction object record is its own record, there can be any combination of A record and B records in the set of junction object records.
When you look at the related list on A, you'll see the list of junction object records, which could all reference the same B record if you wanted. The same thing when you look at the B record -- the related list of junciton object records could all referernce the same A record.
As an added bonus, if you make your junction object Name field an Auto-Number, you can remove it completely from the related list layout, so a User looking at an A record, will have a clickable link directly to the B record instead of a link to the junction object.