To define an index

  1. On the File Definition form of the Database Definition tool, define a new file or select the desired file.
  2. Press Define (F6).
  3. Select Indexes.

    The Index Definition form appears.

    The product line, file name, and file prefix default from the File Definition form. You cannot change them on this form.

    Field Description
    Index Name

    Index name.

    The Lawson Software standard for naming an index is the file prefix, followed by the word SET, followed by a number to represent the index number. For example, the file Department has a file prefix of DPT, making the first index name DPTSET1.

    Duplicates

    Specifies whether to allow the index to have duplicate records (records whose key field values are all identical).

    Note: (Important) The duplicate index feature is no longer supported, although some existing files may contain duplicate indexes. You cannot create a new index that allows duplicates. If an index currently allows duplicates and you want to modify the index in any way, you must change the index so that it does not allow duplicates. When you use the blddbdict utility, you will receive a warning message for any indexes that allow duplicates.
    Primary

    Specifies whether this index is the primary index for the file.

    If you try to save a file definition without assigning a primary index, the warning "File must have a primary index: dictionary will not build" appears.

    If you build the dictionary for a product line containing a file that does not have a primary index, the errors "Primary index not defined for file FileName" and "Dictionary Not Built – Fix Errors and Rebuild" appear.

    Note: (Important) Conditions and duplicate keys are not allowed on the primary index.
    Key Change

    Specifies whether you allow changes to the values of the key fields.

    Yes means that you allow changes to the value of a key field in the index.

    Note, however, that this does not mean users can change the values of key fields on a form and then do a Change or Delete. If users change the value of any key field in the active index of a form (that is, the index that controls how records are selected for the form), they must first do an Inquire. For more information, see the $KEYFCS documentation in the Application Development Workbench Standards manual. To change values in a key field from this index, users must access the field by using a form based on another index that does not include as a key the field you wish to change.

    No prevents any changes to the value of key fields in the index, no matter what index is used for a form.

    Condition Name

    Optional. Condition name, if you want the index to include only the records that satisfy the condition. For more information, see Defining Conditions.

    Note: (Important) You cannot apply conditions to primary indexes.
  4. Press Enter, Tab, or the down arrow.
  5. In the Select Keys subform, press Mark on the key field or fields for the index.
  6. Press Enter.

    The order in which you select key fields determines the order of the fields in the index. For more information, see Manipulating Key Fields in an Index.

    The key fields you select appear in the Key Fields subform. If you typed in a condition name, the condition appears in the Index Records subform.

  7. Press Enter twice to save the index.