Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Validate Duplicate Item Name Before Saving to Database (Without Unique Constraint

Shayan Abid5 days ago — edited 5 days ago

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?

Comments
Post Details
Added 5 days ago
1 comment
73 views