In this video, we're going to learn how to configure database events and how to take them into account in the programming. A trigger (or table method) is used to check on actions performed by the database engine on data:
creation
modification
deletion.
In that sense, a trigger is a method like any other. It's simply the context in which it is executed that changes.
Like form events, database events must be checked so that 4D gives control to the trigger to execute.
We can enable any database event in the Table inspector.
You’ll find the “Edit” button at the bottom right, which allows creating the method to execute when the checked events occur.
The method is generally structured in the following manner:
$evt:=Database event`What is the number of the event being executed by the database event? Case of
:($evt=On Saving New Record Event) `A new record is saved