# File Maintenance Generator

Step 5: File Maintenance Key Settings |

Information about the file, such as the primary Key field(s), required fields, etc., is determined from the embedded data dictionary record on the file at run time.

The options in this step allow you to define either a record query or a fixed key segment if the primary Key has more than a single segment. If defining a record query, a record query button will be added beside the first segment of the key. If defining a fixed key segment and the first segment of the key contains a fixed value that does not change, then that field can be preloaded, and the field disabled or hidden at run time.

If the primary Key has a single segment, the options on this panel will not apply and will be disabled since the record query and fixed key segment are not applicable to a key with only one segment.

If the primary Key has a single segment and a default value is assigned to the segment in the data dictionary, the value will not be applied when the panel is generated. In addition, if the primary Key has more than a single segment, a default value assigned to the last key segment will not be applied.

#### Note:
If editing a primary Key field in NOMADS after generating a file maintenance panel, any tag value entered should be preceded with "TAG=" (case insensitive).
(The use of "TAG=" was added in PxPlus 2021.)

Primary Key Field (single segment) | Primary Key Field (multi-segments)

This panel consists of the following:

Primary Key Field(s) | The primary Key field(s) identifies each record in the file.
| (Display Only) Primary Key field(s) for the data dictionary table selected in Step 1: Definition. #### Note: For single-segment keys, the remainder of the options on this panel do not apply and are disabled.
Record Query | The Record Query applies only to files that have a multi-segment key. When defined, a record query button displays beside the first key segment on the panel. If the Lock First Segment check box is selected, the Record Query fields will be disabled, and the record query button will not display. (The Record Query was added in PxPlus 2023 Update 1.)
Library | Enter the path to the library containing the query definition. The drop-down arrow invokes a list of recently used libraries. The Browse button allows you to browse the directory to find the library.
Panel | Name of the query definition to invoke. The drop-down list contains all panels in the library. If the query has not yet been defined, enter a new name and click the Define Query button to create it. The Return Prime Key Value in Hex check box in Query Header Definition (on the Options tab) must also be selected. #### Note: When entering a new 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.
(Define Query) | Button (beside the Panel drop box) that launches Query Definition (for Standard Query) or Query List Definition (for Query List) using the Panel name to either create a new or edit an existing query definition. If creating a new query definition, a prompt displays for selecting a Query Type.
Bitmap | (Applicable for NOMADS Panels Only) Bitmap to display on the query button. Click the Bitmap Library lookup button to invoke the Bitmaps dialog.
HTML Symbol | (Applicable for HTML Pages Only) A symbol that will be displayed on the query button on the Webster+ HTML page. It can be either a Font Awesome symbol or a standard PxPlus bitmap selected from the Bitmap Library lookup button. For a list of Font Awesome symbols, visit https://fontawesome.com/v4/icons/. #### Note: When specifying the Font Awesome symbol name, do not include the leading 'fa-'.
Fixed Key Segment | Fixed Key Segment applies only to files that have a fixed value, which makes up the first segment of the key.
Lock First Segment | (Not Applicable for Single Segment Keys) If the primary Key has more than a single segment defined, selecting this check box allows the first key segment to be locked to contain a fixed value that does not change. If selected, a value for the fixed key segment must be entered in the Value to Pre-load field.
Behavior | (Available when Lock First Segment check box is selected) Select to Disable or Hide the locked segment at run time.
Value to Pre-load | (Available when Lock First Segment check box is selected) Sets a value to preload, which can be defined as a Fixed value or an Expression.
Cross Reference Key Field | This option is applicable if a unique, single segment key is to be maintained automatically. If a cross reference key is used, this data is stored in the Tag Field property of the control corresponding to the first key segment.
Field that Contains 'Reference Key' | Click the drop-down arrow to select the field that contains the unique identifier generated by the system to cross-reference with the primary Key field.

## See Also

File Maintenance Generator Steps