[Lazarus] Master/detail relationships: what am I missing?
Reinier Olislagers
reinierolislagers at gmail.com
Mon Dec 17 11:43:44 CET 2012
On 17-12-2012 11:07, michael.vancanneyt at wisa.be wrote:
> On Mon, 17 Dec 2012, Reinier Olislagers wrote:
>
>> Hi all,
>>
>> I've been looking into how to use master/detail setups in Lazarus (aka
>> tables with foreign keys).
>>
>> Based on Delphi docs I started writing up & testing this:
>>> See also
>>> http://docwiki.embarcadero.com/RADStudio/XE3/en/Establishing_Master-detail_Relationships_Using_Parameters
<snip>
>>> No need for further code, e.g. to specify default values for the
>>> SALES.CUST_NO field when adding records.
>
> This is wrong. There is a need. This should still be specified.
>
>>
>> I get the form with a combobox for the master field and details grid to
>> run without issue and can insert items in the detail grid but the
>> foreign key to the master table is null for that record.
>
> Correct. You must enter these values yourself in the AfterInsert of the
> detail dataset.
Thanks, Michael... seems like the Delphi docs were a bit too optimistic ;)
Created
http://wiki.freepascal.org/MasterDetail
updates/corrections welcome as usual!
More information about the Lazarus
mailing list