KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Does SET QUERY DESTINATION affect triggers?
PRODUCT: 4D | VERSION: 2004 | PLATFORM: Mac & Win
Published On: August 8, 2007
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

Does SET QUERY DESTINATION affect triggers? The answer is, it depends.

From the Trigger documentation:

"When a trigger is invoked, it executes within the context of the process that attempts the database operation. This process, which invokes the trigger execution, is called the invoking process.


"In particular, the trigger works with the current selections, current records, table read/write states, and record locking operations of the invoking process."


(under the section called "Triggers and the 4D Architecture")

If the call to SET QUERY DESTINATION is executed in 4D Client, the client process is not actually the invoking process. Remember that global processes are actually two processes, one on the client and one on the server. In this case it should not affect the Trigger (which always executes on the server).

If SET QUERY DESTINATION is executed in a Stored Procedure, then it will definitely affect the Trigger since both execute on the server.