ICachedDatasetLookup.Fields

Syntax

Fields: IDatasetInstanceFields;

Description

The Fields property returns a collection of fields by which search is performed.

Example

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Cache: ICachedDataSet;
    CacheField: IDatasetInstanceFields;
    LookCache: ICachedDatasetLookup;
    s: String;
Begin
    Cache := UiTable1.CachedDataset;
    LookCache := Cache.CreateLookup("Field;Field1");
    CacheField := LookCache.Fields;
    CacheField.Item(0).Value := EditBox1.Text;
    CacheField.Item(1).Value := EditBox2.Text;
    If LookCache.Locate Then
        s := LookCache.Lookup("Num1").Item(0).Value As String;
    Else
        s := "Not found";
    End If;
End Sub Button1OnClick;

After executing the example, on pressing the button, the search by cache of the table, set as data source for the UiTable1 component, is performed. The search is performed by two fields of the table, that is Field and Field1. Required data is contained in the EditBox1 and EditBox2 components. In case of successful search the "s" variable contains current value of the table field Num1, otherwise it contains following expression: Not found.

See also:

ICachedDatasetLookup