Portals, multi column relations

Questions and answers for designing and implementing forms in Servoy

Portals, multi column relations

Postby jw » Thu Jul 03, 2003 10:02 am

Hello.

I have a solution where there are tables for employees and projects. Every project has many employees attached to it. I'd like to have a portal on the Employee form for all the projects the employee has participated in.

I have tried to add lots of columns to the project table(employee1, employee2, ...) and tried to use multi column relations to connect them to the employee table, but that did not work. Do multi column relations work on an AND or OR principle?

Is there a better approach?

Thanks in advance.

jw
jw
 

Postby Jan Aleman » Fri Jul 04, 2003 8:31 am

The 'official' way to do this is to create a so called n-m table that will allow you to create an n-m relation (many to many) between the two tables. Create a table called employees_projects that contains:
employees_projects_id INT PK
employee_id INT
project_id INT

and relate both the employees table and the projects table to it. Using a tabless tabpanel on both sides you can relate the records into the employees and project forms.

---------

Do multi column relations work on an AND or OR principle?

AND principle
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth


Return to Forms

Who is online

Users browsing this forum: No registered users and 21 guests

cron