FindByKey(Key: Integer): ITableField;
Key is key of the field by which search is performed.
The FindByKey method searches and returns an object containing a field of the table. The key by which search is performed, is passed by the Key parameter.
Sub Main;
Var
MB: IMetabase;
Table: ITable;
Fields: ITableFields;
Field: ITableField;
s: String;
Begin
MB:=MetabaseClass.Active;
Table:=MB.ItemById("TABLE_1").Bind As ITable;
Fields:=Table.Fields;
Field:=Fields.FindByKey(1);
s:=Field.Name;
End Sub Main;
After executing the example, the "s" variable contains name of the field, key of which equals 1. The table identifier is Table_1.
See also: