# Query Header

> Source: https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header

When creating a new query, first enter a name and then select *Standard Query* in the **Query Type** window. This automatically launches the **Query Header Definition** window for defining the characteristics of the query. You can also edit the header information of an existing query by clicking the *Header* toolbar button on the **[Query Definition](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-definition)** window.

Note:  
When entering a new query object name, valid characters are: letters (A-Z, a-z); numbers (0-9); ~ (tilde); @ (at symbol); . (period); $ (dollar sign); \_ (underscore); - (dash); + (plus sign). If an invalid character is used, a message will display.

## Query Header Definition

The **Query Header Definition** consists of six categories, each with its own tabbed folder: **[File Info](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header#fileinfo)**, **[Display](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header#display)**, **[Options](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header#options)**, **[Font/Color](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header#font)**, **[Interfaces](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header#interfaces)** and **[User Aids](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header#useraids)**. The design properties displayed on each of these tabbed folders are explained below.

![](https://manual.pvxplus.com/migration-assets/2a043a9edf80908220371edd90ca289be04c9802e4f273bbf58c1497c0a31bdf.jpg)

This window consists of the following:

|  |  |
| --- | --- |
| *Panel* | Name of the query. |
| *Show Query+ Options* | Check box to disable/enable options based on their **[Classic Query](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview#classicquery)** vs. **[Query+](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview#queryplus)** availability. |
| **File Info** |  |
| **Data Source** | Options for defining the query's external data source:<br>\|  \|  \|<br>\| --- \| --- \|<br>\| *Database* \| When this check box is selected, the information to be displayed will be from an external database table.<br>If not selected ***(Default)***, the information is assumed to be from a PxPlus data file. \|<br>\| *Database Type* \| Select from the following types: *ODBC, ODBC (Local), Oracle, Oracle (Local), DB2, DB2 (Local), MySQL, MySQL (Local), ADO, ADO (Local)*. \|<br>\| *Database Name* \| Enter the database name (*Fixed* value or *Expression*). \|<br>\| *Connect Option* \| Connection options to be appended to an **OPEN** statement when opening the database, such as PSWD=, USER=, etc. Multiple options are separated by **;** *(semi-colon)*. \| |
| **File/Table** | Name of the primary file or database table to be displayed in the query (*Fixed* value or *Expression*). Data can have embedded or external keys or can be sort files.<br>If your data source is a database, you must select a table name from the drop-down list. Otherwise, you can select a known data file from the Data Dictionary table lookup by clicking the Query Table View button *(magnifying glass)* to display a tree view of table names by Group. For information on creating a filter to locate a specific table name, see **[Filtering the Table Names Lookup](https://manual.pvxplus.com/data-dictionary/data-dictionary-maintenance/filtering-the-table-names-lookup)**.<br>Type the name of a PxPlus View or the pathname of a data file, or click the Browse button to look through the directory structure to find a file. When entering a pathname, if the file has an embedded dictionary, then the embedded dictionary will be used to determine column information. Otherwise, you must manually define the data fields to be used in the query. See **[Field Definition](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/column-options#fielddefinition)**. See also **[Manual Field Definition](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header#manualfielddef)** below. |
| **Key Information** | ***For an External Database Table:***<br>Click the *Define Unique Sort Key* button to display a window where you can define a table key based on fields in the table. The key definition will be added as a connection option on the **OPEN** statement using the KEY= clause.<br>***For a PxPlus Data File:***<br>Select the key (from drop-down selections) to sort the file in the query. (At run time, you can override this setting by loading an alternate key number into the **[%NOMADS'Query_Kno](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/designing-and-using-the-query-subsystem#querykno)** variable.) |
| **Display** |  |
| **Title** | ***(Not Applicable to Drop Query)***<br>Text to appear on the title bar at run time. Click the drop-down arrow for a list of selections: *Fixed*, *Expression, Message Library Reference*. |
| **Columns/Lines** | \|  \|  \|<br>\| --- \| --- \|<br>\| *Static Columns* \| ***(Classic Query Only)***<br>Number of columns to remain fixed and kept on display when the user scrolls horizontally. \|<br>\| *Display Line Height* \| Height of a query line in terms of lines high. Can accommodate larger font sizes. If set > 1 line, then the columns can word wrap.<br>You can also use $0A$ in formulas to break data over multiple lines, showing more information without horizontal scroll. \|<br>\| *Center Text Vertically* \| ***(Query+ Only)***<br>Select this check box to center text vertically in the query line only when *Display Line Height* is > 1.<br>Text that exceeds the column width is truncated and an *ellipsis* (...) is displayed.<br>When not selected *(**default**)*, text is aligned to the top of the query line, and text that exceeds the column width is word wrapped.<br>Note:  <br>When an image is used in the query, the setting is ignored and all text is centered vertically.<br>When the *Show Query+ Options* check box is not selected, the *Center Text Vertically* check box is disabled (not applicable). \|<br>*(The Center Text Vertically option was added in PxPlus 2019.)* |
| **Position** | Column and Line position of the *top left corner* of the panel. Not used if **[Panel Persistence](https://manual.pvxplus.com/nomads-graphical-application/panel-designer/resizing-and-persistence/panel-persistence)** is activated.<br>\|  \|  \|<br>\| --- \| --- \|<br>\| *Absolute* \| Indicates exact position in columns/lines from the top left corner of the display. \|<br>\| *Relative* \| Column/line position relative to main window. \|<br>\| *Centered* \| Position centered relative to the screen (ignores column/line values). \| |
| **Size** | *Width* and *Height* of the panel. Not used if **[Panel Persistence](https://manual.pvxplus.com/nomads-graphical-application/panel-designer/resizing-and-persistence/panel-persistence)** is activated.<br>For ***Classic Queries***, minimum width is 42 columns and height is 10 lines. The minimum ***Query+*** panel is 80 columns by 18 lines.<br>When using ***Query+*** *Toolbar*, *Hybrid* or *Menu* views (see **[Query View](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header#queryview)** option), the panel dimensions can be modified by clicking the **[Test/Design](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-definition#testdesign)** toolbar button to display the query and dragging the edges of the query panel to the desired size. Click the *Save + Exit* button to save and incorporate these settings into the query definition when exiting the query.<br>*(The ability to save query changes when in Test/Design mode was added in PxPlus 2023 Update 1.)* |
| **Grid Lines** | Adds grid lines to the display. Click the drop-down arrow for a list of selections:<br>\|  \|  \|<br>\| --- \| --- \|<br>\| *Default* \| Uses the value set in **[%NOMADS'Query_GridLines](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/designing-and-using-the-query-subsystem#querygridlines)**. Default is no lines. \|<br>\| *None* \| No grid lines are displayed. \|<br>\| *Full grid* \| Grid lines are displayed ***both*** between the columns ***and*** between each line in the output. \|<br>\| *Vertical* \| Vertical grid lines are displayed between columns. \|<br>\| *Horizontal* \| Horizontal grid lines are displayed between lines/rows. \|<br>*(The Grid Lines option was added in PxPlus 2017.)* |
| **Display** | \|  \|  \|<br>\| --- \| --- \|<br>\| *Gray/White Display* \| Check box to display alternating gray and white backgrounds. Default (***Off***) indicates white only. \| |
| **Row Highlight** | ***(Query+ and Drop Query)***<br>\|  \|  \|<br>\| --- \| --- \|<br>\| *Add (Edit) row display option* \| Click the link to invoke the **[Row Display Option](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header#rowdisplay)** window that is used to assign visual attributes, such as bold text, text color or highlight color, to a row based on specified conditions. \|<br>*(The Add (Edit) row display option was added in PxPlus 2021.)* |
| **Options** |  |
| **Query+ Options** | The following options apply to the **[Query+](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview#queryplus)** mode:<br>\|  \|  \|<br>\| --- \| --- \|<br>\| *Query View* \| This option determines how the query will be displayed when assigned as a *Panel* to a Multi-Line. See **[Assigning a Query](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/invoking-a-query#assigningquery)**.<br>Note:  <br>When the Use Classic Query option (see above) is selected, the Query View option is not available.<br>Click the drop-down arrow for a list of selections:<br>*Default*<br>The setting in **[%NOMADS'Query_View](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/designing-and-using-the-query-subsystem#queryview)** is used. If %NOMADS'Query_View is not set, the default will be the *Toolbar* view.<br>*Drop Query*<br>The **[Drop Query](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview#dropquery)** displays data in a *Report View* list box directly on the current panel. Drop queries load the entire dataset prior to display; therefore, it is advisable to prevent queries that are using large datasets from being displayed as Drop queries by setting this option to *Toolbar*, *Menu* or *Hybrid*.<br>*Toolbar*<br>Standard **[Query+](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview#queryplus)** display featuring a toolbar to access features.<br>*Menu*<br>Features are accessed by a menu (no toolbar).<br>*Hybrid*<br>This view has an abridged toolbar with the remaining features available in the menu. The layout is somewhat similar to the **[Classic Query](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview#classicquery)**.<br>*Drop Tree*<br>The **[Drop Tree Query](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview#dropquery)** displays data in a *Tree View* list box directly on the current panel. Drop Tree queries are ***not*** recommended for large datasets, as the entire dataset is loaded prior to display. The Drop Tree supports only the *Find*, *Refresh*, *Print*, *Filters* and *Profile* features in its right-click popup menu.<br>In ***iNomads***, you can also choose to *Set the default Query View* in the **Template Configuration [Misc](https://manual.pvxplus.com/inomads/template-configuration#misc)** tab.<br>All views require the same Query+ activation level. If not activated, then the query will display as a **[Classic Query](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview#classicquery)**.<br>*(The Drop Query selection was added in PxPlus 2016.)  <br>(The Query View option was added in PxPlus 2017.)  <br>(The Menu selection was added in PxPlus 2017.)  <br>(The Hybrid selection was added in PxPlus 2017.)  <br>(The Drop Tree selection was added in PxPlus 2021.)* \|<br>\| *Auto Column Resize* \| Automatically adjusts the sizes of the columns to fit the width of the query.<br>Click the drop-down arrow for a list of selections: *Default, Always, Never*. If set to *Default*, the setting in **[%NOMADS'Query_AutoColSize](https://manual.pvxplus.com/nomads-graphical-application/appendix/nomads-variables/overview#queryautocolsize)** is used.<br>*(The Auto Column Resize option was added in PxPlus 2019.)* \|<br>\| *No Drop Query Header* \| Suppresses the display of the column headings in **[Drop Queries](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview#dropquery)**.<br>Click the drop-down arrow for a list of selections: *Default, Always, Never*. If set to *Default*, the setting in **[%NOMADS'Query_NoDropHeader](https://manual.pvxplus.com/nomads-graphical-application/appendix/nomads-variables/overview#querynodropheader)** is used.<br>*(The No Drop Query Header option was added in PxPlus 2019.)* \| |
| *Use Classic Query* | ***(Classic Query Not Applicable in iNomads)***<br>Check box to force the query to display data using the **[Classic Query](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview#classicquery)** mode. This might be used when the query dataset is very large to avoid out-of-memory issues.<br>Note:  <br>When the Use Classic Query option is selected, the Query View, Auto Column Resize and No Drop Query Header options are *not* available. |
| **All Queries** | The following options apply to all **[Query](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview)** modes:<br>\|  \|  \|<br>\| --- \| --- \|<br>\| *Auto Tab* \| Check box to pre-input a Tab character ($09$) so that when the query is exited, focus will automatically go to the next control in the tab sequence. \|<br>\| *No Print Button* \| Check box to suppress the *Print* button at run time so that users *cannot* print reports. Default (***Off***) enables printing of a simple report showing *title*, *file name*, and *column headings* followed by a list of records that pass the selection criteria.<br>NOMADS automatically adjusts the font size to print all columns on the page. If the font appears too small for the page, you can select landscape orientation. You may need to change the column size and/or the number of fields in the query to have a design that fits. \|<br>\| *Suppress Favorites* \| Suppresses the ability to select and display favorite records at run time.<br>Click the drop-down arrow for a list of selections: *Default*, *Always*, *Never*. If set to *Default*, the setting in **[%NOMADS'Query_Suppress_Favorites](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/designing-and-using-the-query-subsystem#querysuppressfave)** or **[%NOMADS'Query_Suppress_Popup$](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/designing-and-using-the-query-subsystem#querysuppresspopup)** is used. \|<br>\| *Suppress Export* \| Suppresses the *Copy* and *Export* options normally available at run time.<br>Click the drop-down arrow for a list of selections: *Default*, *Always*, *Never*. If set to *Default*, the settings in **[%NOMADS'Query_Suppress_Export](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/designing-and-using-the-query-subsystem#querysuppressexport)** and **[%NOMADS'Query_Suppress_Popup$](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/designing-and-using-the-query-subsystem#querysuppresspopup)** are used. \| |
| *Read as RECORD* | ***(Available Only for Manually-Defined Files)***<br>Forces NOMADS to read the file using **READ RECORD**, making it possible to read and display data from manually defined files that have fixed-length records that may contain binary data. |
| **Classic Query Options** | The following options apply to the **[Classic Query](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview#classicquery)** mode:<br>\|  \|  \|<br>\| --- \| --- \|<br>\| *No Sort By* \| ***(Available when Use Classic Query check box is selected)***<br>Check box to disable the *Sort By* drop box on a **[Classic Query](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview#classicquery)**. The file will be sorted using **[Key Information](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header#keyinfo)** (**File Info** tab). \|<br>\| *Sort by Columns  <br>(Pre-load Data)* \| ***(Available when Use Classic Query check box is selected)***<br>Check box to enable a **[Classic Query](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview#classicquery)** to be sorted by clicking the mouse on a column heading. Subsequent clicks toggle the sort between ascending/descending modes.<br>Default (***Off***) indicates sort by *file keys*. Database tables can only be displayed in *Sort by Columns* mode. PxPlus data files can display either *sort by file keys* or *sort by columns*.<br>Note:   <br>All data must be preloaded to process this option, possibly affecting performance. See [Performance Considerations](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/designing-and-using-the-query-subsystem#performance). \|<br>\| *Switch Scroll Bar  <br>for Large File* \| ***(Available when Use Classic Query check box is selected)***<br>Check box to invoke alternate scroll bar logic to speed up access to large data files in a **[Classic Query](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview#classicquery)**. See **[Performance Considerations](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/designing-and-using-the-query-subsystem#performance)**.<br>Used in conjunction with the **[%NOMADS'Query_Sbar_Max](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/designing-and-using-the-query-subsystem#querysbarmax)** variable. \|<br>\| *Use OK/Cancel Buttons* \| ***(Available when Use Classic Query check box is selected)***<br>*OK/Cancel* buttons are added to the bottom of the run-time **[Classic Query](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview#classicquery)** panel, and the status bar is suppressed (query message is displayed to the left of the button). Selecting *OK* returns the value associated with the query record selected. (Query+ panels have *Select/Close* buttons.) \| |
| **Start At Value** | The *Start At Value* is the value that is passed to the query to determine which record in the query list will be selected when the query is initially loaded. This is done by matching the start value against record keys or return values as the file is read.<br>Two drop box options are available for defining the *Start At Value*: one to determine the case sensitivity of the *Start At Value*, and one to determine how the *Start At Value* is matched.<br>***Case Sensitivity***<br>Click the drop-down arrow for available selections: *Case Sensitive **(Default)***, *Default to Uppercase* and *Default to Lowercase*. By default, the comparison is *Case Sensitive* where the case of both the start value and key value (or return value) must match.<br>It is possible that the start value may be passed in with mixed case; however, the record keys may be all uppercase or lowercase. In these cases, you must set the case of the *Start At Value* to match that of the key values.<br>In the case where the starting value uses the matching option to match the return value, using either the *Default to Uppercase* or *Default to Lowercase* option will result in a case insensitive match.<br>***Match Key Value/Return Value (Available for Query+ Only)***<br>Click the drop-down arrow for available selections: *Match key value **(Default)*** and *Match return value*. By default, the starting value that is passed to the query is tested against the key that is being used to load the query. This is because the starting value generally matches the key value being used to load the query. In this case, the *Match key value* option is applicable.<br>However, there are instances where a query may be loaded using one key, such as a name or a description, but the return value is another key, such as a code or account number. In this case, use the *Match return value* option. Be aware that if there are duplicate return values, the match will occur with the first one encountered.<br>Note:  <br>In the case where the return value is unrelated to the key by which the query is loaded, another way to set up the query is to load the query using the key that matches the return value. Use the [Choose initial sort column](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-definition#initialsort) link on the Query Definition window to set the column by which to sort the query when it is initially displayed.<br>*(The "Match key value" and "Match return value" options were added in PxPlus 2023 Update 1.)* |
| **Return Value** | Indicates the value to be returned when a record is selected. If omitted, the default is the value in the first column of the query.<br>This value can also be used to determine if lines are to be suppressed when duplicate return values are encountered. Use a PxPlus expression.<br>*(The ability to suppress query lines based on duplicate return values was added in PxPlus 2021.)*<br>\|  \|  \|<br>\| --- \| --- \|<br>\| *No Return Value* \| Check box to ensure that the **Return Value** is not set when the query panel is exited.<br>When a query is invoked, you can pass a **Start At** value as an argument. When the query panel exits, the same argument is used for the **Return Value**. Rather than loading this argument with the value of the currently selected record, the argument is left unchanged. The value in a control with an attached query is not changed when the query ends. \|<br>\| *Return Prime Key value in Hex* \| Check box to return the Hex value of the Primary key. This option applies only when using files with multi-segment keys and must be selected when adding a query to the Webster+ HTML page. See **[Step 5: Keys](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/fmgen/key-settings#recordqry)** in the File Maintenance Generator.<br>When this check box is selected, the **Return Value** multi-line input displays *HTA(Prime_key$)* and is disabled.<br>When it is not selected, the **Return Value** multi-line input displays *Default (first column)* and is enabled.<br>*(The Return Prime Key value in Hex option was added in PxPlus 2023 Update 1.)* \|<br>\| *Build Return Value* \| Click the link to invoke the **[Build Return Value](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header#returnvalue)** window for defining the **Return Value**. \|<br>Values can be returned for a single field or multiple fields concatenated in a format you can parse after the value is returned:<br>```<br>PROD_ID$ CST_SMN$+","+CST_NAME$(1,1)<br>PAD(X1$,6)+PAD(X2$,12)+STR(LNK.AMT:"00000.00")<br>SLS.FLD#1*100<br>```<br>You can also gain access to external keys using the special NOMADS query variable **[PRIME_KEY$](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/designing-and-using-the-query-subsystem#primekey)** and return an entire record using the special NOMADS query variable **[ENTIRE_RECORD$](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/designing-and-using-the-query-subsystem#entirerecord)**:<br>PRIME_KEY$+ENTIRE_RECORD$ |
| **Font/Color** |  |
| **Font Specification** | \|  \|  \|<br>\| --- \| --- \|<br>\| *Font* \| Select an existing font by name. Applies to ***screen presentation only***. Fonts for printed reports are selected separately. \|<br>\| *Size* \| Select from the list of available sizes (specific to the selected font) or enter a specific size. Positive sizes relate to the current font (1=Regular, 2=Double, .5=Half, etc.). Negative values are point sizes. Use in conjunction with the *Display Line Height* setting (see **[Display](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header#display)** tab) to display larger fonts. \|<br>*(Font support for Query+ was added in PxPlus 2021.)* |
| **Color** | \|  \|  \|<br>\| --- \| --- \|<br>\| *Background  <br>Foreground* \| ***(For Classic Query)*** Select the background and foreground colors for the query panel label region (not the area where records are listed).  <br>  <br>***(For Query+)*** The background color applies to the panel background (the area below the records list), and the foreground color has no effect.<br>Click the Query button to access **[Color Selections](https://manual.pvxplus.com/nomads-graphical-application/appendix/color-selections)**. Valid formats for color selections include predefined system colors (e.g. Light Red), Custom (RGB codes), HTML Hex Color Codes, User Defined colors (e.g. Color17) and string Expressions. \|<br>*(The Color Selections Query button and dialog were added in PxPlus 2020.)*  <br>*(Background color support for Query+ was added in PxPlus 2021.)* |
| **Attributes** | Check boxes to apply font attributes. Overrides Library and Panel defaults.<br>Available selections are *Bold*, *Italics*, and *ANSI Characters*. When the *ANSI Characters* check box is set to ***Off***, you can use other character sets such as *Wing Dings*.<br>*(Font attributes support for Query+ was added in PxPlus 2021.)* |
| **Theme** | Assign a Theme to be applied to the query. The Theme can be defined as a *Fixed* value or string *Expression*.<br>Click the Theme Maintenance button to launch the **[Themes Maintenance](https://manual.pvxplus.com/nomads-graphical-application/system-maintenance-tools/system-options/themes#themesutil)** utility for creating and editing themes.<br>Note:  <br>A Theme specified at the Query level takes precedence over Themes set at the panel level, the Library level ([Library Defaults](https://manual.pvxplus.com/nomads-graphical-application/nomads-development/maintaining-library-objects/library-defaults#fonttab)) or the General level Theme set in [%NOMADS'Theme$](https://manual.pvxplus.com/nomads-graphical-application/appendix/nomads-variables/overview#theme).  <br>  <br>A Theme assigned to the [%NOMADS'ThemeOverride$](https://manual.pvxplus.com/nomads-graphical-application/appendix/nomads-variables/overview#themeoverride) property overrides all other Theme settings. See [Applying a Theme to Your Application](https://manual.pvxplus.com/nomads-graphical-application/system-maintenance-tools/system-options/themes#applyingtheme).<br>*(Theme support was added in PxPlus 2019.)  <br>(The Theme Maintenance button in Query Header Definition was added in PxPlus 2020.)* |
| **Interfaces** |  |
| **Initialization Procedure** | Optional program to be called prior to opening the query panel. You may pass a comma-separated list of up to 20 optional parameters using the format: *"program;label",arg$, arg$, arg$...* |
| **Closing Procedure** | Optional program to be called upon exiting the query panel. You may pass a comma-separated list of up to 20 optional parameters using the format: *"program;label",arg$, arg$, arg$...* |
| **Maintenance** | Maintenance program for updating the file:<br>\|  \|  \|<br>\| --- \| --- \|<br>\| *Library* \| Select a maintenance library name from the drop-down list, click the Browse button to look through the directory structure to find the library or type the library path. An expression can also be entered by preceding the expression with an ***=*** *(equals sign)*; e.g. *=libname$* or *="mylib.en"*.<br>Note:  <br>The Library name may be a specific or generic reference. See [Cascading Language Suffixes](https://manual.pvxplus.com/nomads-graphical-application/multilingual-capabilities/cascading-language-suffixes/overview).<br>*(Support for entering an expression for a Library name was added in PxPlus 2019.)* \|<br>\| *Panel* \| Select a file maintenance panel name from the drop-down list. If included, the user can edit the main data file by clicking the *Edit File* button at run time. The key of the currently selected record is passed to the maintenance program as ARG_1$, and the value returned in this argument is used to reposition the file.<br>In the **[Classic Query](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview#classicquery)**, if no records exist for display in the query at run time, the File Maintenance program is automatically invoked. If left blank, the button is suppressed when the query is run. \| |
| **User Aids** |  |
| **Help Reference** | ***(Classic Query Only)***<br>Help text. Select from *External* or *Internal* Help types. At run time, Help is invoked by pressing **Shift - F1**.<br>\|  \|  \|<br>\| --- \| --- \|<br>\| *Internal* \| Application supplied message text. Available selections are:<br>*Fixed*<br>Displays the text as entered.<br>*Expression*<br>Indicates that the Help file to be displayed is stored in a string variable or simple expression.<br>*Message Lib Ref*<br>Specify a *Key* associated with an existing message in the current message library. \|<br>\| *External* \| Standard windows Help system consisting of a Help file name and an optional Keyword or Reference number (*Fixed* or *Expression*). Available selections are:<br>*Fixed*<br>Allows you to enter the name of a Windows Help file.<br>*Keyword*<br>Indicates that the text in the adjacent field is the index entry for the topic in the indicated Help file.<br>*Reference*<br>Indicates that the adjacent field contains the reference number for a specific topic in the context sensitive help.<br>*Popup*<br>Check box to indicate that the Help topic will be displayed as a popup rather than as an independent window.<br>*Expression*<br>Indicates that the Help file to be displayed is stored in a string variable or simple expression.<br>*Test*<br>Button used to test the Help display. \| |
| **Message Bar** | ***(Classic Query Only)***<br>Message text to be displayed at the bottom of the panel. Available selections are:<br>\|  \|  \|<br>\| --- \| --- \|<br>\| *Fixed* \| Displays text as entered. \|<br>\| *Expression* \| Indicates that the Help file to be displayed is stored in a string variable or simple expression. \|<br>\| *Message Lib Ref* \| Takes the message text from the indicated keyed file. \| |

Note:  
To set various [Display](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header#display), [Options](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header#options) and [Font/Color](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header#font) properties simultaneously on multiple query definitions in a library, see [Query Bulk Edit](https://manual.pvxplus.com/nomads-graphical-application/nomads-development/maintaining-library-objects/query-bulk-edit).

## Row Display Option

The **Row Display Option** window is used to assign visual attributes, such as bold text, text color or highlight color, to a row in the query data list. The various visual attributes can be assigned based on specified conditions being met.

To assign visual attributes to a column, see **[Query Column Display](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-definition)**.

Note:  
Display settings on individual columns will override Row Display settings.

***Invoking Row Display Option***

In **Query Header Definition**, on the **[Display](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header#rowhighlight)** tab, click the link *Add (Edit) row display option* (under the **Row Highlight** heading).

![](https://manual.pvxplus.com/migration-assets/c2a9af32df20aed19b88483c41b3e535cdf4ba1d8fa7890fd4639d66c475ad67.jpg)

*(The Row Display Option window was added in PxPlus 2021.)*

This window consists of the following:

|  |  |
| --- | --- |
| **Display Method** | The following methods are available to assign various visual attributes to a row:<br>\|  \|  \|<br>\| --- \| --- \|<br>\| *None* \| No display method. ***(Default)*** \|<br>\| *BoldText* \| Display text in bold font. \|<br>\| *Colors* \| Set text and background colors. \|<br>\| *HiLiteColor* \| Set background colors. \|<br>\| *TextColor* \| Set text colors. \|<br>\| *User* \| Specify your own display strings. \| |
| **Parameter Values** | Specify the query fields that are to be used as part of a condition.<br>***To Add a Parameter:***<br>Click the *Add* button (next to *Parameter Values*) and then click the drop-down arrow at the right of the newly-allotted parameter to select a field from the list, or define field characteristics (i.e. field number, offset, length) for manual fields.<br>Formulas must be named to be included as additional parameters. See **[Query Formula Definition](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-definition)**.<br>Each parameter is assigned an ID (such as %1, %2, etc.) that is to be used in a condition rather than the actual name of the field.<br>***To Remove a Parameter:***<br>Select the parameter entry to be deleted and then click the *Remove* button (next to *Parameter Values*). To select multiple entries, use Shift-Click (consecutive selections) or Ctrl-Click (random selections).<br>Prior to deleting, a message will display. |
| **Condition** | Set conditions for the assigned visual attribute(s). Conditions consist of PxPlus expressions that can be evaluated to zero/non-zero, but using the ID placeholder in the place of a field name; e.g. %1="Y".<br>***To Add a Condition:***<br>Click the *Add* button (below *Condition* grid) and then enter the condition.<br>Multiple conditions can be defined, each with its own assigned display setting (i.e. color, image, etc.).<br>Conditions are evaluated in the order in which they appear until a condition evaluates as true (i.e. non-zero). This means that if two conditions are set, %1\<10 and %1\<100, then values less than 10 will be assigned the first display setting, and values from 10 to less than 100 will be assigned the second display setting.<br>Values that fall outside of the range of the specified conditions may or may not have an assigned display setting. To assign a setting to these values, simply add a blank condition at the end and assign a display setting. Otherwise, no display setting will be assigned, and default text and color will be used for these values.<br>Use the Move Up/Move Down buttons (below *Condition* grid) to change the order of the conditions.<br>***To Remove a Condition:***<br>Select the condition entry to be deleted and then click the *Remove* button (below *Condition* grid). To select multiple entries, use Shift-Click (consecutive selections) or Ctrl-Click (random selections).<br>Prior to deleting, a message will display. |
| *Color* | ***(Display Method is Colors, HiLiteColor or TextColor)***<br>To assign a color to a condition, click the dotted button at the right of the Color cell to launch the **[Color Selections](https://manual.pvxplus.com/nomads-graphical-application/appendix/color-selections)** window.<br>Note:  <br>Selecting Default (i.e. no color) is a valid selection. |
| *Display String* | ***(Display Method is User)***<br>Display strings allow greater flexibility when assigning display attributes for particular conditions; e.g. you can mix bold text and background color.<br>Display strings are PxPlus expressions; therefore, select the *Exp* check box and enter the expression to use.<br>***Example:***<br>'\_COLOR'("Light Yellow")+'BB'<br>Note:  <br>Be sure to use placeholder IDs rather than field name variables in your expression, if required. |

You can also create your own display methods by creating your own display class. The existing methods are in the **\*obj/qrycoldsp** class. Create your own class and inherit the **\*obj/qrycoldsp** class in yours by using **LIKE "\*obj/qrycoldsp"** in its definition. Then incorporate your new methods. Set **[%NOMADS'Query_ColumnDisplay$](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/designing-and-using-the-query-subsystem#querycoldis)** to the name of your class, and your new methods will become available.

## Row Display Examples

Below are examples of setting up row display scenarios:

|  |  |
| --- | --- |
| ***Example 1:***<br>Your query has a BALANCE column.<br>Based on its value, you want the row to display using Red text if the value of BALANCE is negative and Green text if the value is 10000 or greater.<br>The remaining rows are to display using the default text color. | ***To do this:***<br>Assign *TextColor* as the *Display Method*.<br>The conditions are based on the BALANCE column; therefore, select BALANCE from the drop-down list of *Parameter Values*. It is assigned an ID of %1.<br>Then create two *Conditions*:<br>%1\<0<br>%1>=10000<br>For the first *Condition*, assign Light Red as the *Color*, and Dark Green for the second *Condition*. |
| ***Example 2:***<br>Your query has a CUSTOMER_CLASS$ column.<br>You want to display a record in **bold text** if CUSTOMER_CLASS$ contains the value "VAR". | ***To do this:***<br>Assign *BoldText* as the *Display Method*.<br>The condition is based on the CUSTOMER_CLASS$ column; therefore, select CUSTOMER_CLASS$ from the drop-down list of *Parameter Values*. It is assigned an ID of %1.<br>Then create the *Condition:*<br>%1="VAR" |

## Build Return Value

The **Build Return Value** window is invoked by clicking the *Build Return Value* link on the **Query Header Definition [Options](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/query-header#returnvaluehead)** tab (under the **Return Value** heading). It is used for defining the ***Return Value*** (value to be returned when a record is selected).

![](https://manual.pvxplus.com/migration-assets/dc22d92079d05ae4b2081dc20d629b46b2b3377e149f92810a3e75ff5ed11077.jpg)

Note:  
When working in this window, you *cannot* use external keys or functions in your expression. They *must* be entered directly into the Return Value input field.

This window consists of the following:

|  |  |
| --- | --- |
| **Field Definition** | \|  \|  \|<br>\| --- \| --- \|<br>\| *File* \| Name of the file or table to be used in building the return value. Click the drop-down arrow for a list of the main and link files used in the query. If the file is not maintained in the data dictionary, you must define the data fields manually. See **Manual Field Definition** below, as well as **[Field Definition](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/column-options#fielddefinition)**. \|<br>\| *Elements* \| List of elements for the selected file. \|<br>\| *Selected* \| List of elements that comprise the return value. \|<br>\| *Add* \| Adds an item from the *Elements* list to the *Selected* list. \|<br>\| *Remove* \| Removes a *Selected* item. \| |
| **Manual Field Definition** | \|  \|  \|<br>\| --- \| --- \|<br>\| *Field No.* \| Ordinal position/sequence number of the field to be displayed in this column. The first field is number 1. If your manual file has an external key, define it as field #0 *(zero)*. \|<br>\| *Offset  <br>Size* \| Use *Offset* and *Size* to define sub-strings. The first character of a string has an *Offset* of 1. *Size* indicates the number of characters in the sub-string. \|<br>\| **Type** \| Select a field type: *String* or *Numeric*. \|<br>\| *Add* \| Adds the manual field definition to the *Selected* list. \| |
