User Guide > Objects > Alphabetical Listing > Dynamic PromptSet Dialog

Dynamic PromptSet Dialogs

AE provides additional methods that can be used to structure the input masks of tasks dynamically. Combo boxes and an Input Assistant for text fields whose contents can vary depending on the values of other PromptSet elements are available for this purpose.

The following steps are required in order to create a PromptSet dialog using a dynamic combo box or the Input Assistant for the text field:

  1. Create a PromptSet object with at least one text field or combo box.
  2. For the text field, use the property "Input Assistant".
  3. For the combo box, set the property "Dynamic".
  4. Use a Variable object with the sources EXEC, SQL, SQLI, FILELIST or BACKEND as a data reference for the text field / combo box.
  5. Enter one or several PromptSet variables of other elements of the same PromptSet in this reference Variable object.
    PromptSet variables can be used in the following fields of the reference variable's Variable tab:
    VARA.EXEC: Parameter
    VARA.SQL, VARA.SEC_SQL
    : connection, login, SQL statement
    VARA.SQLI, VARA.SEC_SQLI: SQL query (AE DB)
    VARA.FILELIST: host, login, directory
    VARA.BACKEND: host, login, command

No special settings are required for the Input Assistant because the reference variable is only resolved when it is accessed.

Note that PromptSet variables that are defined as an array (multi selection) cannot be used in reference variables.

If you want to use PromptSet variables in Variable objects, you must ensure that the value 3 is set in VAR_SECURITY_LEVEL (UC_SYSTEM_SETTINGS). Note that this limitation does not apply to the SQL statements of VARA objects that use the sources SQL SECURE and SQLI SECURE.

A default value must be set in the PromptSet object for the elements whose values are used in the required fields of VARA objects (such as Host and Login).

Examples:

The following example creates a PromptSet dialog with a dynamic combo box whose content depends on a radio button field. The radio button field should be used to specify an AE client. The combo box then always lists the selected client's tasks.
The reference values of both PromptSet elements are directly retrieved from the AE databaseA database is an organized collection of data including relevant data structures. via SQLI variables.

Reference variables

Create the reference sources for the PromptSet object. Create two Variable objects, each with the source SQLI.

The first variable is used to supply the AE system clients. Insert the following SQL command in the VARA object's Variable tab (MS SQL Server):

select distinct EH_Client from EH

The second variable retrieves the task names depending on the selected AE client. In the SQL command, you can use the expected variable name of the radio button as the client value for this purpose. Doing so results in the following command:

select distinct EH_Name from EH where EH_Client=&CLIENT#

Check the first variable by clicking the Preview button in the Variable tab. Note that you cannot test the second variable because the PromptSet variable &CLIENT# cannot yet be resolved.

Ensure that the system setting (UC_SYSTEM_SETTINGS - SQLVAR_INTERNAL) and the privilege for internal SQL variables have been provided.

PromptSet objects

In the next step, we create the PromptSet object with a radio button field and a combo box.

Assign the SQL variable that retrieves the AE client as a data reference to the radio button field. Verify that this element's variable name complies with the name that has been used in the SQL command of the other Variable object (see above). In this example, the variable name is CLIENT# (without a leading &).

Assign the other reference Variable object to the combo box.
Important note: Set the option Dynamic . Otherwise, an SQL error will occur when the PromptSet dialog is called.
Reason: Setting this option has the effect that the reference variable is only resolved when the combo box is called. If it is not set, it is resolved even before the PromptSet variables are available.

Note that opening the combo box also results in an error if the element on which it depends includes an invalid value or no value at all. Automic recommends setting a default value for the element that provides the value.

Finally, call the PromptSet preview in order to test the input mask's functionality.