FireDAC.Comp.DataSet.TFDDataSet.MasterFields

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property MasterFields: String read GetMasterFields write SetMasterFields;

C++

__property System::UnicodeString MasterFields = {read=GetMasterFields, write=SetMasterFields};

Properties

Type Visibility Source Unit Parent
property public
FireDAC.Comp.DataSet.pas
FireDAC.Comp.DataSet.hpp
FireDAC.Comp.DataSet TFDDataSet

Description

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';

See Also