FieldByKey(Key: Integer): ITableField;
Key is field key.
The FieldByKey method executes transition to a table field. The field key 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.FieldByKey(10);
s:=Field.Name;
End Sub Main;
After executing the example, the "s" variable contains name of the field, key of which equals 10. The table identifier is Table_1.
See also: