4D v14

Triggers

Home

 
4D v14
Triggers

Triggers    


 

 

In addition to the manipulations explained in the video, you should also note that:  

By calling an ENGINE event, there’s an important precision to note: triggers are executed on the triggers database engine:

  • In single-user, it’s the 4D program that contains both the database event and the return event (displays, etc.).
  • In client/server mode (SQL server or Web server), data is stored on the server and sent to client machines using the 4D Server engine. In this case, triggers are executed on the server and not locally on the client machines.

Generally speaking, get used to creating project methods that take care of your processes, calculations, etc. and call these “generic” methods from specific methods such as triggers.

We saw how to pass parameters, so make good use of it! It’s a lot easier to maintain and you save a considerable amount of time developing as well as bug fixing. Your code will be a lot more concise, reliable, and readable.

You can execute cascading triggers. In this case, 4D has commands that allow finding out the trigger properties and its cascade level.

A trigger can also serve to "accept" or "reject" any operation attempt on the record.

This is a way to allow you to ensure the integrity of your database regardless of how information is processed:

  • SQL
  • plug-in
  • input
  • import
  • Web

Knowing that a trigger blocks the other processes during execution, the main rules to follow in a trigger are:

  • speed of execution
  • no interface (alerts, messages, etc.)

 
 

 
PROPERTIES 

Product: 4D
Theme: Triggers

 
ARTICLE USAGE

Self-training ( 4D v13)
Self-training ( 4D v14)