Selecting data and formatting the query

This section describes how to make selections that affect the output of the data.

General tab options

The General tab contains the Query Builder (click the hyperlink to open a dialog box of options). When you are creating a new query, always start by specifying the query with the Query Builder tool.

General tab option Description
API This is the query string that you build when you click the hyperlink.
Use Webuser PDL When this option is selected, the query runs against the data area of the user who is running the query. If this option is not selected, the query is run against the data area of the user who created the query.
Max records Number of records retrieved in a fetch. Default is 25 records.
Page size Determines the size of the block of data for display purposes. Default is 25 records.
Representation

The form the output takes. Choices are:

  • Table

Sort Records

Sort all records selected in the query. Choices are:

  • Ascending

  • Descending

  • None (no sort performed)

Link Records

Choices are Drill and Form.

If you select Drill, users of the query can drill on records (that have drill data available).

If you select Form, you are prompted to specify the form token (for example, hr11.1). Your query can be linked to either the drill around feature (for fields that have drill data) or a form.

Tooltip: If you select Form, you can type a short description that shows when users move the pointer over the record.

Fields tab options

Options on the Fields tab determine formatting of the results of the query. The options are blanked out until the API has been built. Options can be specified for each field in the query.

The Fields tab is divided into two sub-tabs, Header and Body. The Header sub-tab is for formatting the query of the header, such things as, the displayed field and heading names, alignment, font, and sort order. The Body sub-tab is for formatting the data for the query.

Form clip: Data Query dialog showing Fields tab, Header sub-tab
Header sub-tab option Description
Font Change the font style of the header record.
Size Change the font size of the header record.
Color Change the font color of the header record.
Rearrange Rows Select a field on the Fields tab and click the Up or Down button to move the field to a higher or lower position in the query output.
Caption Type a unique heading for the column, if desired. Default is the field name formatted with initial capitals and spaces.
Align Alignment of the data. Choices are: Right, Left, or Center
Sort Add ability to perform a runtime sort on this column, that is, to change the order of a column while viewing the output.
Form clip: Data Query dialog showing Fields tab, Body sub-tab
Body sub-tab option Description
Checkbox

You can use a check box to add interactive capability to a data query. If you select this option, a check box is added to left of each record that results from the query. You could use this feature to let users of your query select a record for transaction as they view the results of the query.

Example: Checkbox in data query output

Custom scripting is required to determine what action is taken when the check box is selected.

Button

You can use a button to add some minor transaction capability to a report. You can add a button to the right of each record that results from the query that allows users to perform a function with the data as they review the query.

For example, suppose you created a query to retrieve records of information about purchase orders. You could create a button called "Release" that you would attach to each record, so that the user could release purchase orders while reviewing them.

Button Title: Adds a description to the header that describes the button.

Button Value: The text that displays where the user selects the button.

Example: Button in data query output

Custom scripting is required to determine what action is taken when the button is clicked.

Both Use this feature to add both a check box and a button to a data query.
Sort Order

Type a number to indicate the priority of this field in the sort hierarchy.

For example, if you make these specifications for sort order of fields:

COMPANY=1 LAST-NAME=2 FIRST-NAME== 3

The resulting records display by COMPANY, and within COMPANY, they are sorted by LAST-NAME and then FIRST-NAME.

The default is the order the records are stored in the database.

Tooltip Descriptive text that appears when a user mouses over this field in the query output.
Wrap Allows the body text for this field to wrap within the column which can, sometimes, make the output easier to read.
Drill Enable the Drill Around feature for the field.
Hide Field Data from this field will be used in the query but will not show in the output.

Index tab options

Use the Data Query dialog Index tab to make selections for index values.

Form clip: Data Query dialog showing Index tab
Index tab option Description
Value

Select a default value for the key field. When you click the hyperlink, a dialog box for selecting a default value appears. Choices are:

  • Literal: The default value is a literal string. Type the string in the text box.

  • UserEnv: the default is a value from the environment file for the user (stored in the Web User file). Select the default from the list that appears on the screen.

Trigger Refresh When objects are mapped, any change to a custom page data source refreshes the object with new data. See "Mapping Data Objects".
Label If a filter is used, you can add a label for display purposes for this key. Default is the field name formatted with initial capitals and spaces.
Read Only If a filter is used, selecting this property means that the value of the key cannot be changed when it is displayed.
Hide If a filter is used, the data from this key will not show in the filter.

Condition tab options

Use the Condition tab to specify selection conditions for the query, that is, conditions records must meet to be selected.

Form clip: Data Query dialog box showing Condition tab
Condition tab option Description
Apply If a filter is used, click to include the condition to your query.
Caption Rename the condition for display purposes in a filter.
Initial Query Apply this condition to the first query that is executed.
Hide Do not show this condition in the filter.

Criteria tab

The Criteria tab can be used in the rare cases when a string search is the only way to retrieve the data you are looking for. Type the string of selection criteria in the text box.

A string search performs a complete table scan which can make the object slow to load. A string search is not recommended for use against tables with large volumes of data.

Form clip: Criteria tab