Silent: Boolean;
The Silent property determines a method that is used to open an object. This is relevant only for the Object.Open command.
The property is set to False by default, an object is opened and the visual interface set in the platform for this object is shown on the desktop. If the property is set to True, the visual interface is not displayed on the desktop, and the result of executing the Execute command is a collection of parameter values for the opened object.
Executing the example requires a form with the Button1 button and a repository object with the Query identifier that supports command of object opening. This object includes one advanced parameter.
Add links to the Forms, Metabase, and Ui system assemblies.
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 canceled");
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: