Page 1 of 1

UniDAC/PostgreSQL/MasterDetail problem

Posted: Fri 12 Nov 2010 05:21
by jbakuwel
Hi,

UniDAC 3.00.0.10 / PostgreSQL 8.3 / Delphi 2010

I have two tables in a master detail relationship. I add one record to the master table, post this, verifies it gets inserted in the database. The I add a detail record, post this, verifies it gets inserted in the database. So far so good.

However, the detail record doesn't display on the screen. When enabling debugging on the detail DataSet and browsing through the master DataSet, I can see the detail records are correctly retrieved for any of the already existing (ie prior to adding new as described above), but not for the new detail record just added to the database. In this case the query "SELECT * FROM detai> WHERE detail.pk IS NULL" is generated (ie. "IS NULL" instead of the corresponding primary key of the master record).

Closing and opening the detail dataset makes no difference, however closing and opening the master dataset "fixes" the problem.

It look very much like the bug reported here:

http://www.devart.com/forums/viewtopic. ... elect+null

however I cannot find the property RefreshParamsOnInsert.

Please advise.

kind regards,
Jan

Posted: Fri 12 Nov 2010 08:55
by AlexP
Hello,

The RefreshParamsOnInsert variable is declared in the DBAccess unit. Check that the DBAccess unit was added to the uses section and set RefreshParamsOnInsert to true.

Posted: Mon 15 Nov 2010 09:15
by swierzbicki
Please add this property in the TXXXConnection options as this is not the default TDataset behaviour...

Posted: Mon 15 Nov 2010 09:42
by AlexP
Hello,

We will investigate the possibility of adding this feature in one of the next builds/versions of DAC.

Posted: Mon 15 Nov 2010 10:10
by swierzbicki
thank you in advance Alex.