AnyDAC
ContentsIndexHome
PreviousUpNext
TADDataSet.MasterFields Property

Gets / sets fields in master dataset, used to establish a master-detail relationship with this dataset.

Group
Links

Use MasterFields property value to specify semicolon separated list of the master dataset field names, used to establish a master-detail relationship with this dataset. 

Specify MasterFields property value after assigning MasterSource property value. The mechanism used to filter this detail dataset records depends on the dataset class:

  • TADQuery and TADStoredProc will match master fields to this query / procedure parameters by their names. When the master dataset current record is changed, then this dataset parameters will get values from the corresponding MasterFields.
  • TADMemTable will match master fields to this dataset indexed fields by their positions. When the master dataset current record is changed, then a range will be applied to this dataset, where starting and ending range values are equal to the corresponding MasterFields field values. The application must have a current active index. The indexed fields will be the detail dataset fields used to establish mater-detail.
property MasterFields: String;
ADMemTable1.IndexFieldNames := 'CustomerID';
ADMemTable1.MasterSource := CustomersDS;
ADMemTable1.MasterFields := 'ID';
What do you think about this topic? Send feedback!