Check Unique Key

The Check Unique Key server behavior allows the developer to check if a certain submitted value is unique before using it in a transaction. This means that you can check the table for another entry, to ensure no duplicates exist.

To add a Check Unique Key trigger into the page, you must follow the next steps:

  1. First create an Insert, Update, Custom or Login transaction. The server behavior is implemented as a trigger, therefore a transaction must exist on the page, so that the trigger can register to it. If more then one transaction exists, the trigger will register to all of them.
  2. Access the server behavior from the Application panel, Server Behaviors -> + -> MX Kollection -> Form Validation -> Check Unique Key.
  3. The user interface that opens is divided into two tabs. Configure these tabs as follows:
    · The Basic tab, where options regarding the field and value to check can be set.
    · The Advanced tab, where you can set trigger properties.

  4. Once you're done setting the options, click OK to apply the server behavior.

The Basic tab

In this part of the user interface you can set options regarding what table field to check:

 

To set the dialog box options, follow the next steps:

  1. In the Table drop-down menu, the table used in the transactions on page is automatically selected and the drop-down menu is disabled.

  2. In the Column drop-down menu all fields belonging to the table selected above are displayed. Select the field to check for unique values.

  3. In the Error message text area enter the text to be displayed if another entry has been found in the table. You can use the InterAKT Dynamic Data (the lighting bolt icon) to build the message.

  4. The three buttons in the top right corner of the interface offer you the next functionalities:
    · Click OK when you are done configuring the trigger.
    · Click Cancel to exit without applying the new settings.
    · The Help button opens this help page.
    These buttons are common to both tabs of the Check Unique Key interface.

  5. Click on the Advanced tab to continue with configuring the trigger.

The Advanced tab

This section of the dialog box allows setting the trigger properties:

 

For instructions on completing this step, see the Advanced tab. For the Check Unique Key trigger, by default the Priority is set to 30 and the Type is BEFORE, as it should execute before the transaction takes place.

The server behavior added this way can be edited later by double-clicking its name in the Server Behaviors tab of the Application panel.