MacroDialogInvoker
The execution context of an audit test / a Standard Import Routine subtask includes a service that allows the invocation of embedded macro dialogs. This service is only available during the local execution of an audit step / a Standard Import Routine subtask.
The following code retrieves a reference to the macro dialog invoker.
Dim dialogInvoker As Object
Set dialogInvoker = SmartContext.GetServiceById("MacroDialogInvoker")
If the service is not available, GetServiceById returns nothing.
The dialog invoker object implements the MacroDialogInvoker interface and provides two methods:
-
NewTaskParameters()
This method returns an object that implements the MacroDialogTaskParameters interface. The object can be used to specify the actual parameters for a macro dialog invocation. It supports the following three properties:- Inputs
Gets a reference to a case-insensitive dictionary that maps parameter (or control) names to values (or control content values). This collection can be used to specify the actual parameters of the dialog. - TableNames
Gets a reference to a case-insensitive dictionary that maps table aliases to table file names. This collection can be used to specify the tables that the dialog expects. - TablesAreOnServer
Gets/sets a Boolean value indicating whether the tables in TableNames are located on the server. It returns true if the tables are located on the server, otherwise false. The default value is false.
- Inputs
-
PerformTask(dialogId, args)
This method invokes the specified dialog using a set of parameters.
dialogId: A string containing the identifier of the dialog to invoke. If a dialog with the specified ID cannot be found, an exception is thrown.
args: A task parameters object obtained by a call to NewTaskParameters containing the actual parameters for the dialog invocation or nothing if the invocation does not require any actual parameters. It returns a result object (that implements the MacroCialogTaskResult interface) containing the results of the invocation. The result object has the following two properties:- AIIOK
Gets a Boolean value indicating whether the dialog was processed and all parameters were OK. It returns true if the dialog was processed and all parameters were OK, otherwise it returns false. - Outputs
Gets a reference to a dictionary containing the new values of the parameters. It returns a case-insensitive dictionary that maps parameter (or control) names to parameter (or control content) values containing the actual values of the parameters that were set during the invocation. An empty collection is returned if the dialog was cancelled.
- AIIOK