IUiCommandExecutionContext.ExecutionMode

Syntax

ExecutionMode: UiCommandExecutionMode;

Description

The ExecutionMode property determines the mode of command execution.

Example

Executing the example requires a form with the Button1 button and a repository object with the Query identifier that supports command of object opening. The object includes an advanced parameter.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

Mb: IMetabase;

ObjDes: IMetabaseObjectDescriptor;

Target: IUiCommandTarget;

Context: IUiCommandExecutionContext;

Params: IMetabaseObjectParamValues;

Param: IMetabaseObjectParamValue;

i: Integer;

Begin

MB := MetabaseClass.Active;

ObjDes := MB.ItemById("Query");

Target := WinApplication.Instance.GetObjectTarget(ObjDes);

Context := Target.CreateExecutionContext;

Context.ExecutionMode := UiCommandExecutionMode.PromptUser;

Context.Silent := True;

Params := Target.Execute("Object.Open", Context) As IMetabaseObjectParamValues;

If Params <> Null Then

For i := 0 To Params.Count - 1 Do

Param := Params.Item(i);

Debug.WriteLine("Parameter: " + Param.Name + "; Value:" + Param.Value);

End For;

Else

Debug.WriteLine("Setting parameter values is cancelled");

End If;

End Sub Button1OnClick;

Executing the example and clicking the button initializes a dialog box for setting parameter values, which is used at object opening. Object is not opened. After clicking the OK button in the dialog box, the list of parameters and their values are shown in the development environment console.

See also:

IUiCommandExecutionContext