FireDAC.Comp.Client.TFDTable.MasterFields
Delphi
property MasterFields;
C++
__property MasterFields = {default=0};
Contents
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
property | published | FireDAC.Comp.Client.pas FireDAC.Comp.Client.hpp |
FireDAC.Comp.Client | TFDTable |
Description
Gets/sets fields in the master dataset, used to establish a master-detail relationship with this dataset.
FireDAC.Comp.Client.TFDTable.MasterFields inherits from FireDAC.Comp.DataSet.TFDDataSet.MasterFields. All content below this line refers to FireDAC.Comp.DataSet.TFDDataSet.MasterFields.
Gets/sets fields in the master dataset, used to establish a master-detail relationship with this dataset.
Use the MasterFields property to specify a semicolon separated list of the master dataset field names, used to establish a master-detail relationship with this dataset.
Specify the MasterFields property value after assigning the MasterSource property value. The mechanism used to filter the records of this detail dataset depends on the dataset class:
- TFDQuery and TFDStoredProc match master fields to this query/procedure parameters by their names. When the master dataset current record is changed, the parameters of this dataset get values from the corresponding MasterFields.
- TFDMemTable matches the master fields to this dataset indexed fields by their positions. When the master dataset current record is changed, a range is applied to this dataset, where the starting and ending range values are equal to the corresponding MasterFields field values. The application must have a current active index. The indexed fields are the detail dataset fields used to establish a master-detail relationship.
Example
FDMemTable1.IndexFieldNames := 'CustomerID';
FDMemTable1.MasterSource := CustomersDS;
FDMemTable1.MasterFields := 'ID';