Manually Fetching Detail Rows

Hi All

My custom DA servers runs in the cloud on an Amazon EC2 server. Obviously, this will result in some delay in fetching records and that is all expected. I’m having several master / detail setups that I need som help in tuning. They all work and load detail data. However, due to the delay in loading data, there is a 2 - 3 seconds delay when I change master record in a grid. This is off course because the detail data is being fetched every time the user change the record in the master dataset. I need this to not take place so I set the set dtAutoFetch to false for the detail tables. Now the user can browse the master data without any delay. All good at this point.

Now, when the user double click a row in the grid, I open an edit form, and at this point I want to load the detail data. I found an example on this forum by calling tbl_DETAIL.FetchMastersDetails(tbl_MASTER, nil, True)

This call does not results in any detail record being loaded at all. How can I on request load detail data?

I’m using the latest DA release and Delphi 10.2

Thanks
Eivind

is your detail table already opened?
if not, you need to open it like

if not tbl_DETAIL.Active then 
  tbl_DETAIL.Open
else
  tbl_DETAIL.FetchMastersDetails(nil, nil, True);

Hi

Thanks for your answer. The Detail dataset is opened, however, I put in the code that you suggested just to verify. Still the tbl_DETAIL.FetchMastersDetails(nil, nil, True); does not load any detail records. Just to be clear, in the DetailTable–>DetailOptions I set the dtAutoFetch to False. To verify that my master / detail setup is working, if the set the dtAutoFetch to True, it shows the correct detail records for the appropriate master records. However, I cannot have it like this, as the fetch for details locks up the main thread for 2 - 3 seconds.

Any further help on how to load detail records on demand would be highly appreciated

Thanks

Eivind

What MasterMappingMode you are using? mmWhere?
if mmWhere is used, tbl_DETAIL.RefreshFromServer; also should work