Skip to content

A Custom Event needs to both hard-stop an unauthorized action (via Error_SYS.Record_General, which rolls back the transaction) AND send a notification email about the attempted action — but the transaction rollback from Error_SYS also seems to prevent the Command_SYS.Mail() notification from actually going out. How can both happen together?

Answer

Send the notification email via a deferred call (background job) rather than directly inside the same event/transaction — a deferred call runs as its own independent background transaction, so it isn't rolled back when the main transaction is rolled back by the Error_SYS-triggered hard stop. Call Command_SYS.Mail() from within the deferred, background-job procedure instead of directly in the blocking event action, and the notification email survives the rollback while the hard-stop error still correctly blocks the original unauthorized action.

← Browse Platform, Aurena, and customization questions