[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GNUe] Inverse Master/Detail relations

From: Andreas Fromm
Subject: Re: [GNUe] Inverse Master/Detail relations
Date: Tue, 16 Aug 2005 23:46:49 +0200
User-agent: Debian Thunderbird 1.0.2 (X11/20050602)

Hash: SHA1

James Thompson wrote:

> For existing records I don't see any problem using forms standard
> master/detail. Just still use the customer table as the master.
> Forms doesn't map master/detail to any type of primary/foreign key
> relationship in the backend. Instead master/detail simple says if
> the master changes update the detail blocks to reflect the proper
> values. So in that case I don't see an issue.
> Thinking it through I guess new records would cause a problem as I
> believe the master is always inserted before the details. In these
> cases you would have to fall back to triggers to populate the key
> fields prior to committing the data.
> I *think* something like this should do it if you're using a db
> that supports sequences.
> <trigger type="PRE-INSERT" name="fldAddress"><![CDATA[ # Set
> default value if self.isEmpty():
> self.autofillBySequence('seq_address_id') ]]></trigger>
> But I don't have a working form with this logic so it may need a
> little work to make it happy.
> Hope this helps, James

Thank you for your replay. With your suggestion I can insert new
records now! When I tryed to set the M/D things up, I got some strange
problems, but I think I did something wrong that time. My problem now
is that I had to delete the referencing constrain on the column, to
allaw the master record to be stored before the detail record.

Can I execute the insertion of the detail record from the trigger, so
that the referencing constrain can be left in the database?

Another question about dropdown boxes. Can I set up a dropdown or a
list box which doesn't offer the a blank entry as an option?


Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -


reply via email to

[Prev in Thread] Current Thread [Next in Thread]