ICachedDataset.MasterFields

Syntax

MasterFields: String;

Description

The MasterFields property determines the list of fields of the main data source, by which the filtering of data in the linked data source is performed.

Example

Executing the example requires two tables with the Table_1 and Table_2 identifiers in repository.

Sub UserProc;
Var
    MB: IMetabase;
    DSInst, DSInst1: IDatasetInstance;
    Cache, Cache1: ICachedDataset;
Begin
    MB := MetabaseClass.Active;
    DSInst := MB.ItemById("Table_1").Open(NullAs IDatasetInstance;
    DSInst1 := MB.ItemById("Table_2").Open(NullAs IDatasetInstance;
    Cache := DSInst.OpenCached;
    Cache1 := DSInst1.OpenCached;
    Cache.IndexFields := "FIELD2";
    Cache.MasterFields := "FIELD_2";
    Cache.MasterSource := Cache1;
    Cache1.First;
    While Not Cache1.Eof Do
        Debug.WriteLine(Cache.RecordCountAll);
        Cache1.Next;
    End While;
End Sub UserProc;

After executing the example, two tables are connected. The field of the main table from which the data is taken has the FIELD_2 identifier; the field of the dependent table, by which filtering according to data from the first table is performed, has the FIELD2 identifier. All records of the main table will be checked. Quantity of records in the linked table, received as a result of filtering by data of each record of the main table, is displayed in the console.

See also:

ICachedDataset