AnsweredAssumed Answered

Related tables and portal controls

Question asked by BarryIrvine on Aug 15, 2011
Latest reply on Aug 15, 2011 by BarryIrvine

Title

Related tables and portal controls

Post

Hi,

I'm new to Filemaker but very experienced with relational databases but I'm struggling getting to grips with the layout controls regarding one-to-many relationships.

I have a Customer record with a cust_id serial number primary key and I have linked this to a table Address with a relationship based on the cust_id. it should be possible to have multiple addresses in the table for a customer. E.g. Work or Home (I've defined this as a radio button set on a field called Address Type). There is a unique key constraint on this table based on the calculated value of "Address Type & cust_id - e.g. it is only possible to have one address of each type per customer. I have added the address table to my customer layout and by defining the "Allow creation of records in this table via this relationship" and "Delete related records..." I should be able to add and create Home and/or Work addresses for Customers from the main layout.

In broad terms this works but obviously when I change the value of the radio button it doesn't automatically query the data in the address table if it already exists for that Address Type.

I then tried adding a portal to Address to my layout instead but I can't make head nor tail of how I'm supposed to get this working for a relationship where 0, 1 or 2 records could exist for the Customer.

Can anyone give me some tips as to where exactly I'm going wrong?


Thanks in advance,

Barry

 

Outcomes