What is Duplicate Value Validation?
By enabling validation on duplicate values, you can prevent duplicate records within its related form. The following guide will take the order management scenario as an example. With this feature, for each order, its related order detail records must not contain duplicate products.
What Does It Look Like?
The validation should result in the following behaviors:
If duplicate products are included in the Order Details field, the form submission should be blocked.
When adding a record in the related form, if the added product code already exists in the order details, the new entry should be failed.
Prerequisite
The following three forms are required for this setup:
Order: Captures basic order information and includes a related form field linked to the Order Details form.
Order Details: Captures line items for each order and pulls product data from the Product Information form via related fields.
Product Information: Stores the base product data.
Setting Concept
In this case, the duplicate value validation is applied to check multiple related records (order details) in a single master record (order). Depending on how the data is entered, the validation approach varies across two stages:
Stage 1 Simultaneous Entry of Master and Related Data
Scenario: While creating a new order, you can simultaneously add multiple order detail entries in the related form field.
Validation Method: Enable the "Duplicate values are not allowed when filling in a single record" option in the Field Properties.
Stage 2: Separate Entry of Related Data
Scenario: After the order has already been created, you later add or update order details.
Validation Method: Add an auxiliary field that names "Order Name + Product Code" to uniquely identify each detail line and check No duplicate sfor this field.
Note:
When master and related data are submitted together, the "No duplicate " setting on related form fields does not take effect.
How to Configure It?
Step 1 Configuring the Order Details Form
In the Order Details Form, configure an auxiliary field that uniquely identifies each order detail entry and enables duplicate value validation.
On the design page of Order Details, click the Lookup field related to the Order form. In Field Properties > Data Filling, select a unique identifier such as the Order Name.
Note:
Do not use Serial No. as unique identifiers, because they may not be filled during simultaneous entry.
Similarly, set the Serial No. as the unique identifier for the Related Product field.
Add a Single Line field as an auxiliary field and configure:
Name: Duplicate Check
Formula: CONCATENATE(Order Name, Product Code)
Validation: No duplicates
Field Permissions: Uncheck the View option
In Form Properties > Hidden Field Default Value, select Always Recalculate from the dropdown list.
Step 2 Configuring the Related Form Field
Go to the design page of the Order form and select the Order Details field. In Field Properties > Display Fields, tick Product Code from the dropdown list.
Under Data Permissions, enable Duplicate values are not allowed when filling in a single record and set Product Code as the field to check for duplicates.