I’m trying to display a message box in an HSQLDB trigger block within a LibreOffice Base form and can’t get it working.
I have a LO Base app using a split HSQLDB 2.3.2. It includes a table “checks” that has a boolean column “issued”. When issued is “true” I want to prevent deletion of that row. So I created the following trigger to detect this condition and prevent deletion:
CREATE TRIGGER "delete_check" BEFORE DELETE ON "checks"
REFERENCING OLD AS oldrow
FOR EACH ROW WHEN (oldrow."issued" = true)
BEGIN ATOMIC
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Issued check cannot be deleted';
END;
When I use the built-in grid view and try to delete a row with the issued flag set, the message box DOES pop up as expected.
But running in a Base form and trying to delete the row using the navigation bar, the message box does not pop up. (In either case the row is not deleted, which is good because it means the trigger is working.)
How can I get the message box to display from an HSQLDB trigger block within an LibreOffice Base form?