Page 1 of 1

[Solved] Help preventing deletion in a table or form via Tri

PostPosted: Sat May 23, 2020 8:37 am
by gkick
Hi,

Is it possible to use a BEFORE DELETE Trigger in an HSQL2.5 backend based on a particular criteria and display a messagebox that this record can not be deleted and leaving the record(s) in place?

Example ... any invoice where payment > 0 can not be deleted

Thanks

Re: Help with preventing deletion in a table or form via Tri

PostPosted: Sat May 23, 2020 9:13 am
by Villeroy
Referencial integrity does that by default. Having a 1-n relation between a table of payments (n) and a table of invoices (1) you can not delete any invoice having an entry in the payments table.

Re: Help with preventing deletion in a table or form via Tri

PostPosted: Sat May 23, 2020 3:01 pm
by Sliderule
gkick wrote:Is it possible to use a BEFORE DELETE Trigger in an HSQL2.5 backend based on a particular criteria and display a messagebox that this record can not be deleted and leaving the record(s) in place?

Example ... any invoice where payment > 0 can not be deleted

Yes.

Re: Help with preventing deletion in a table or form via Tri

PostPosted: Sat May 23, 2020 5:34 pm
by gkick
Thanks gentlemen!