relating to a subset of child records?

I’ve got a master table and separate addresses table, the addresses table is a child of the master and includes a field which contains a copy of the master PK (boring so far?).

But, there can be different types of addresses (e.g. postal/delivery/billing) so the address record is qualified with a “type” field. So to go from a master to the related postal address we select from addresses where addr.type=“POST” and addr.mast_id=mast.mast_id. To construct a relationship I’ve used a composite filed consisting of mast.mast_id+a global variable (which obviously must be initialised to “POST”) from the master table and addr.mast_id+addr.type from the address table.

Am I on the right path here, or is there a better way of doing this in Servoy?

Thanks,
Neale.

Hi Neale,

I would do this the same way.

In the master table construct a multi key from:
-mast.mast_id+a global variable
(note: using a global doesn’t store your address choice when you exit solution)
You may want to use a table column here instead)

Actually you want to be able to specify a constant directly in the relation?