Editing Current Master Record Changes Current Record in Detail Table
Posted: Thu 08 Feb 2018 08:05
Good day
I have a Firebird 3 database with a master-detail setup on two tables. Suppose that I am currently viewing the third record in the detail table. If I edit any field in the master record, the current record in the detail table is reset to the first record.
Example:
This causes the program to go into an endless loop, since the detail table never gets passed the first record.
Is this expected behaviour?
PS: CachedUpdates = False | LocalMasterDetail = True
Thank you.
I have a Firebird 3 database with a master-detail setup on two tables. Suppose that I am currently viewing the third record in the detail table. If I edit any field in the master record, the current record in the detail table is reset to the first record.
Example:
Code: Select all
MasterTable.Edit;
while not(DetailTable.Eof) do
begin
MasterTable['TotalOrders'] := MasterTable.FieldByName('TotalOrders').AsCurrency + DetailTable.FieldByName('OrderValue').AsCurrency; // <-- resets detail table to first record
DetailTable.Next;
end;
MasterTable.Post;
Is this expected behaviour?
PS: CachedUpdates = False | LocalMasterDetail = True
Thank you.