Avoid invalid duplicate or null key errors

Applies to User Roles:

System Administrator

Records cannot have duplicate Unique or No Duplicates keys. This example shows one such error and how to fix it.

To handle an invalid duplicate of NULL key error:

  1. Open the form in Database Manager. For this example, open the following form:contacts. Be sure to select the Administration Mode check box.

    A blank contacts form opens.

  2. Type NewAdvantage in the Employee ID field., and then click Search.
  3. Select Mass Update. from the tool bar to begin updating the records shown in the Record List.

    Database Manager displays the initial form again.

  4. On the displayed form, type NewAdvantage in the Contact Name field.
  5. Click Simple Update.

    • The system accepts the first update, because the contact name is unique.
    • The system rejects the second update, since changing it would create a duplicate contact name.

    Database Manager opens the record for modification and displays an error message.

  6. Click View Messages to check the messages for errors.

    • A blue icon indicates a required action.
    • A yellow icon indicates an informational or warning message.
    • A red icon indicates an error message.
  7. At this point, there are several options concerning the outcome of this process.
    • Enter a unique key and click Retry for each item on the list separately, to cause Service Manager to reexecute everything, including the Format Control.
    • Click Skip to cause Service Manager to skip the record.
    • Click Force to cause Service Manager to update the record with the information you entered, regardless of Format Control.

    For this example, modify the Contact Name field value to make it unique for each item. (NewAdvantage2, NewAdvantage3, NewAdvantage4, and so on.)

    If the update was successful, Service Manager displays the following message: “<n>records updated in the contacts file.”

  8. Type NewAdvantage in the Employee ID (user.id) field, and then click Search.

    Database Manager displays the records you have just added in a record list.

    The Employee ID values consist of Advantage + 1000, 1001, and so on, and the Contact Name values the first and the last names. The original records listed before the Mass Add remain in the contacts file, with no changes to the original data.

The topics below comprise an example of how to use multiple-record functions. Follow the steps in this order. If you skip a step, the example will not work.

  1. Add multiple records using a literal value
  2. Add multiple records using a variable value
  3. Update multiple records using a literal value
  4. Update multiple records using a variable value
  5. Avoid invalid or null key errors
  6. Delete multiple records

Related topics

Multiple-record functions
Adding multiple records
Updating multiple records
Format Control

Determine the number of records in a record list
Open a record using Database Manager

Key type definitions
Mass add/update function errors