You need to sign in to do that
Don't have an account?
Making Many-Many Relationships Work in UI
I have two custom objects (Survey and Question) that are m-n linked via junction objects (SurveyQuestion has a lookup relationship to each). I can use these junction objects just fine in my Apex code but I'd like to define some report types that can operate across the relationship. Is this possible?
From the developer resources (http://wiki.apexdevnet.com/index.php/An_Introduction_to_Force_Database) it says I should be using master-detail relationships but gives no further instructions. In another online document (many to many relationships.doc) it says to use lookup relationships as I have done. That document also suggests that the tabs for the related objects can be customized to traverse the junction object automatically but that document is for an earlier UI version and it no longer applies.
Are there any current documents that describe how to make these relationships really work in the UI?
Jeff
Hi Jeff,
If you want true many-to-many that includes referential integrity (meaning if the parent is deleted, the cascading children are too), then you should be using Master-Detail.
SurveyQuestion should have two Master-Detail fields, one to Survey and one to Question. SurveyQuestion will inherit the tab color of the first parent field created. More can be found here.
Hope that helps,
Sati
All Answers
Hi Jeff,
If you want true many-to-many that includes referential integrity (meaning if the parent is deleted, the cascading children are too), then you should be using Master-Detail.
SurveyQuestion should have two Master-Detail fields, one to Survey and one to Question. SurveyQuestion will inherit the tab color of the first parent field created. More can be found here.
Hope that helps,
Sati
Thanks for the reference, that surely clears things up.
Jeff