4 Replies Latest reply on Feb 11, 2013 9:20 AM by philmodjunk

    newbee question



      newbee question


           Hi all,

           I have 3 tables with many fields of which I will only mention the most important ones for this question:

           - clients (fields: client id, clientname )
           - groups (fields: group id, groupname, client id, category, date)
           - groups_clients (group id, client id, creation date)

           Clients and groups are related through 'groups_clients', so I can choose / add members to the group by selecting client numbers/names in a portal in 'groups'.

           How can I show in a layout from the table 'clients' from which groups a client is a member? How can I automate this? One client can be a member of several groups and a group can contain several clients of course.

           thnx in advance,

           regards, swanny

        • 1. Re: newbee question

               On the Clients layout, add a portal based on the groups_clients table and in that portal place the groupname field from the groups table.

          • 2. Re: newbee question

                 thankx DaSaint, yes this is a good solution. The only problem I foresee is that once I delete a group, the group info will be lost in the clients table too and I wish it to be static information. I've read a lot of negative comments about copy/paste, is there another way though?



            • 3. Re: newbee question

                   Why would you delete a group that's in use by your clients?

                   You can delete records in your groups_clients table without a problem. Maybe at some point a client doesnt' belong to a certain group anymore.

                   But deleting a group from the groups table sounds like a bad idea.

                   What might work is looking up the group info in the groups_clients table but then you are duplicating a lot of data and you are not really respecting the rules of relational database design.

                   So I would say: Don't delete the groups.

              • 4. Re: newbee question

                     - groups (fields: group id, groupname, client id, category, date)

                     The field in red makes no sense in terms of your database design. It would appear to be a field that you can remove from this table.