AnyDAC
ContentsIndexHome
PreviousUpNext
TADMasterDataLink.Synchronize Method

Synchronizes detail dataset with master dataset.

Group
Links
Parameters 
Description 
AWithDetails: Boolean = True 
If True, then will be synchronized all sub-detail datasets too. 

Call Synchronize method to synchronize not yet refreshed detail dataset with the master dataset. The method is useful when delayed refreshing is in effect (TADDataSet.FetchOptions.DetailDelay > 0) or when refreshing is disabled (DisableScroll). 

Optionally, you can use DisableDelayedScroll / EnableDelayedScroll to temporary disable / enable delayed refreshing.

procedure Synchronize(AWithDetails: Boolean = True);
qMaster.First;
while not qMaster.Eof do begin
  if qMaster.Fields[i].AsInteger = 100 then begin
    qDetail.MasterLink.Synchronize(True);
    // read qDetail dataset - here it is synchronized with qMaster
  end;
  qMaster.Next;
end;
What do you think about this topic? Send feedback!