Separate Found Sets, Global Relations, SQL Views

I have 2 conceptual types ‘Contacts’ and ‘Companies’ that share the same table ‘Contacts’. They are differentiated with a boolean flag called ‘record_type’

I want the conventional List/Detail view of both companies and contacts.
However, companies and contacts shouldn’t share foundsets. But of course the list/detail views of each of them should.

My dilema is this: Specifying that a form use a separate foundset seems to mean that its foundset is separate from all child forms as well. Therefore, I cannot separate the foundsets of Contacts and Companies w/o losing the link between List and Detail views of each.

I tried using global relations to separate the two, but relations are not foundsets in and of themselves. Therefore, I run into the same problem.

Is there a way around this?
SQL Views would do the trick, but Servoy is not recognizing them yet.
But a view is essentially what I need.

help!

In Servoy 3.0 views are supported, aren’t they?

Paul

pbakker:
In Servoy 3.0 views are supported, aren’t they?

Paul

Yes.

First of all, are you sure that companies and contacts shouldn’t be separated into separate tables? Do companies ever become contacts, or vice versa? Even though many of the fields may be similar for both types, you might be better off separating them.

In our solution, we use a controller.loadRecords(parent.foundset) for every unrelated nested form. I don’t know if this is what Servoy intended, but we found it necessary.

When you switch between list and detail, you can just do a loadRecords from the other form: e.g. forms.detailView.controller.loadRecords(forms.listView.foundset)

Also, I thought you could make a self join on the table, aka contacts_to_contacts based on contactID

and then…

forms.detailView.controller.loadRecords(contacts_to_contacts)

Or, just put a method on the detailView form that takes in a contactID. Have it find the record, and then show the form in dialog. Then call it from the list view.