FieldEditor Command

Purpose

Opens a standard dialog box that is used to edit table field parameters.

Parameters of Use

Command parameters are passed in the Data property. Executing the command requires to determine the following value in this property:

Value type Description
ITableField The table field, for which it is necessary to open a parameter editing dialog box.

Application Features

It is used for table fields.

Example

Executing the example requires a form and a button named Button1 on the form. The repository contains a table with the Table_1 identifier.

Add links to the Forms, Metabase, Db, and UI system assemblies.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    MB: IMetabase;
    Table: ITable;
    Field: ITableField;
    Target: IUiCommandTarget;
    Context: IUiCommandExecutionContext;
Begin
    MB := MetabaseClass.Active;
    Table := MB.ItemById("Table_1").Bind As ITable;
    Field := Table.Fields.Item(0);
    Target := WinApplication.Instance.GetPluginTarget("Db");
    Context := Target.CreateExecutionContext;
    Context.Data := Field;
    Target.Execute("FieldEditor", Context);
End Sub Button1OnClick;

Clicking the button opens a dialog box to edit parameters of the first field of the Table_1 table.

See also:

IUiCommandTarget.Execute