This topic is locked

Can Detail Tables have Two Masters?

5/29/2008 8:50:05 PM
PHPRunner General questions
W
w3bmaster author

Hi,
I am having problems properly configuring multiple Master->Detail associations where a table has two Masters.
My table setup:
user - Master Table #1

user.Id

user.UserName

user.Password
_userownership - Master Table #2/Detail Table of Master Table #1

user_ownership.Id

user_ownership.OwnerId <---user.Id - User that adds a record
_userdetail - Detail Table for Master Tables #1 and #2

user_detail.Id

user_detail.UserId <---user.Id - User the details are about

user_detail.OwnerId <---user_ownership.Id - User who created this user_detail record

user_detail.RealName

user_detail.Email

.......
_userfile - Detail Table #2 for Master Table #2)

user_file.Id

user_file.OwnerId <---user_ownership.Id - User who created this user_file record

user_file.FileName

.......
user_faq, user_knowledge_base, and more with OwnerId's.
I wanted to be able to go straight to a User's 'user_detail' record OR straight to a 'user_ownership' list view from the 'user' List View. I tried to accomplish this by assigning user_detail with two Master->Detail relationships, but my attempts were unsuccessful.
If I set one Master->Detail relationship for user.Id->user_details.UserId, as soon as I try to setup the second relationship (user.Id->user_ownership.OwnerId) the first relationship will not persist...the configuration just disappears, and I also receive Reset warnings in the Visual Editor for the User List View.
Please let me know how to solve this.
Thank you for such a great product!

J
Jane 5/30/2008

Hi,
you can do the following:

  1. create custom view of user_detail table on the Datasource tables tab,
  2. use this view as detail table for Master Table #2.

W
w3bmaster author 6/2/2008

Thank you Jane...that works perfectly.