I have a master TClientDataSet, which is also a detail dataset. This dataset is named MasterDetail1.
Another dataset, DetailSet1, is a detailset of the MasterDetail1.
The query for DetailSet1 is
SELECT *
FROM readoutprobe_containers
WHERE id = :parent_container
Where the value of the parent_container
parameter is obtained through a DataSource getting its data from the master data set.
As long as the MasterDetail1 dataset has more than one record, the DetailSet1 dataset shows appropriate data.
However, when the MasterDetail1 dataset is empty, the DetailSet1 dataset shows the last populated record from the MasterDetail1 data, which is wrong data. When the master set got no data, the detailset should show no data as well.
How to achieve an empty DetailSet1 when its master data is empty?
MasterDetail1
has apoFetchDetailsOnDemand
flag activated as detailed in the documentation here. I think you readFROM
a temporary buffer atFROM readoutprobe_containers
. I think it would be a good idea to either clear the on-demand flag, or to populate a fresh copy of the buffer everytime you fire the request. – Organon