How to prevent duplication
10 February 2025
How to prevent duplication. We will use the example on Sales Order screen.
This event handler is executed before a SOOrder record is persisted (saved) to the database. It checks if an order with the same CustomerRefNbr (customer reference number) and OrderType already exists in the database. If such an order is found, the code throws a custom exception, preventing the current order from being saved.