I have a Master-Detail page in Oracle APEX with an editable Interactive Grid for SALES_ORDER_DETAIL.
Before the Interactive Grid data is saved to the database, I want to validate that the same Item Name has not been added more than once within the current Sales Order.
If a duplicate Item Name is found (for example, "Laptop" appears twice), the save operation should be cancelled and a user-friendly error message should be displayed, such as:
Item "Laptop" has already been added to this Sales Order.
Important:
- I do not want to use a database UNIQUE constraint.
- I want the validation to occur before the data is inserted or updated in the database.
- The validation should detect duplicates among newly added rows in the Interactive Grid, not just rows that already exist in the database.
What is the recommended approach to achieve this in Oracle APEX?