I want to do a match with field “owner” on the left and field “participants” on the right. Owner is required to have one and only one value. Participants is required to have the owner value but may have additional values.
I need a relationship that returns all records on the right where the owner value is a member of participants. In Servoy, are relationships only exact match? Is there a way to set up a relationship to behave like: owner >> participants?
It is not possible to expres that in generic SQL (relation format), is it possbile to combine the related values in goups and relate on such group?
Otherwise whould controller.loadRecords(pkdataset) work in this case?
Jan Blok:
Otherwise whould controller.loadRecords(pkdataset) work in this case?
I briefly looked at controller.loadRecords(relationship_name) as a work around but I don’t quite understand all the in’s and out’s of how this function works. As far as I can tell, you need a relationship name to go between the parens or just “foundset”. And the form that the controller goes with is also displayed instead of keeping you on the current form. “pkdataset” is also a new string that I am unaware of and not sure how to use.
I want to show records in a tab panel where the “owner” value of the current parent record appears in the child field “participants.” The “participants” field can have a number of “owner” names so an exact match is not possible to determine from the owner record as the “owner” field only has one value and knows nothing of the other values in “participants” field in the child record. And I want to do this with multiple tab panels on the owner form. Said another way: the owner record is a form that has multiple tab panels displaying records from multiple ‘child’ tables that the owner name is a participant in. The child records can have any number of owners able to view them depending on what owner names are included in the “participants” field.
This is a useful behavior with FileMaker relationships (relationships match on “exact” and “included in”) and I’m just so ingrained with FileMaker techniques that I don’t know how to do some things I want to do utilizing only exact match relations in Servoy.
In this case it’s the best to use a so called N-M table. For example say you have People and Projects. Multiple people can be involved in multiple projects. You put a table in between called people_projects that maps people to projects. This table will contain one row for each join between a person and a project. To show in which projects a person is involved create a relation in people_projects to projects, put the related field projectname on a people_projects form and show that form in a tabless tabpanel (or with tabs if you want to show other forms as well) in the peoples form. I will write an article for Servoy Magazine with an example to explain this in further detail.