Relations Not Working

Attached is the solution I am using to teach myself Servoy.

I am having trouble seeing the company to project assignments, project to companies, project to people…Strangely people can see there assignment to a project.

Please have a look and let me know what I have done wrong…I have looked so much I am blind to it all.

Thanks

Hi anon,

I took a quick look (haven’t got too much spare time at the moment)

First thing I noticed is that your schema supports many-to-many relationships between, for example, companies to projects.

Servoy does not yet natively support pipelining of data from more than one relational hop away, however you can do this by basing a form on the join table and bringing related fields onto that form.

I feel that this is underpinning some of the unusual behaviour which you are experiencing…

e.g. In your companies tab on the main nav form you have three other tabs (employees, projects, addresses)

The Project tab shows as relationless and so it cannot display projects related to the company through this view.

You need to base a form upon your join table, ‘projectcompanies’ and then place fields from the companies table on that form.

Then this join table form becomes the one that you use in the tabpanel object.

There is a good article originally written by Jan Aleman outlining how to work with M2M relationships whioch will explain it far better than I and it is on Servoy Magazine :
http://www.servoymagazine.com/home/2004/10/article_nm_rela.html

Cheers
Harry

Harry,

The Project tab shows as relationless and so it cannot display projects related to the company through this view.
You need to base a form upon your join table, ‘projectcompanies’ and then place fields from the companies table on that form.

This is what I find confusing. The form projects, is based on the “projectcompanies”…the relationship of prople to projects is similar if not the same…but yet from the main People form the projects are visible on the project tab.

The join table form seems interesting, I have never done one, I will need to work it out.

Thanks, off to Servoy Magazine now…

After reading the article it turns out my “projectcompanies” table is a “Join Table”…cool.

chow

The form may be based upon the correct table but you added the tab as a relationless tab.

Thus it could not resolve the related foundset without you doing it expressly by query.

Try changing the project tab to the one which uses the ‘companies_to_projectcompanies’ relationship and check again

Cheers
Harry

Thank, you were correct.

It must have happened when I was modifing tables.

Lesson learnt.

Chow