Creating dynamic search menus
Instead of hard-coding a search menu's data source, you can specify that the source server and form be dynamically selected at runtime according to values that a users or workflow enters in specified fields. For example, the Dynamic Search Menu form in the following figure, contains two fields (server and form) that can be hidden or display-only. The values entered into these fields (for example, from a Set Fields action) at runtime determine which server and form are used as sources for the search menu. Administrators might prefer to hide this functionality from users and use the Window Loaded execution condition instead.
In this example, two requests exist in the Help Desk Request form on the server cordova. If users open the Dynamic Search Menu form in the , enter cordova in the server field and Help Desk Request in the form field, and then click the search menu button attached to the Submitter field, the search menu queries the Help Desk Request form on the source server (cordova), and the returned values are used to dynamically add items to the search menu (Joe User and Josephine User).
To create dynamic search menus
- In , select File > New > Search Menu.
- Select the server on which to create the menu, and click Finish.
- In the Refresh list, select the appropriate refresh mode.
See Setting-a-refresh-mode-for-menus. - In the Data Source list, select SAMPLE DATA.
- In the following fields, enter a server and form to use to add "sample" items to the menu:
- Sample Server
- Sample Form Name
The sample server and form are used as temporary references to create the dynamic search menu. You can even delete the sample form after saving the menu. What is important is having a sample form from which to select Label and Value fields in step 7.
By default, the current server is selected.
You can select a different server from the drop-down list.
To select a form, click the ellipsis button next to the Sample Form Name field, and use the Form Selector dialog box.
To shorten the list of available forms in the Form Selector dialog box:- In the Name field, enter the initial letters of the form name.
- In the Application field, select the appropriate application.
To find a form in the Available Forms list, perform one of these actions: - Scroll through the list.
- In the Locate field, enter the first characters of the form name.
- To specify the fields that determine which server and form are used at runtime, click the ellipsis buttons next to the following fields, and use the Field Selector dialog box.
- Runtime Server
- Runtime Form Value
The fields listed in the Field Selector dialog box come from the sample form. To shorten the list of available fields, enter the initial letters of the field name in the Name field. To find a field in the Available Fields list, perform one of these actions, scroll through the list or enter the first characters of the field name into the Locate field.
At runtime, the server and form that a user or workflow enters into the specified fields are queried to dynamically build the search menu.
For the example in Creating-dynamic-tables, the Runtime Server field is set to server, and the Runtime Form Value is set to form.
- Go to step 8 in Creating-search-menus and perform the remaining steps in that procedure.