trigger write

System trigger that handles processing when a new or modified occurrence is written to the database.

Declaration: trigger write
Applies to: Entity
Activation: Activated during store statement processing for each new or modified database occurrence.
Default behavior: None
Behavior upon completion: If $status is less than zero, database I/O is terminated; no further triggers are activated for the current I/O request.

Description

This trigger is used to specify the processing that should be done when a new or modified occurrence is written to the database. The modification status of the occurrence is available by way of the ProcScript function $occmod.

This trigger is activated only for Down entities. (If an entity is an Up entity, the writeUp trigger is activated instead.)

If the write trigger contains only a single write statement, Uniface carries out the write action without invoking the ProcScript interpreter (unless the Debugger is active).

Trigger Activation

The write trigger is activated during store statement processing, for each new or modified database occurrence, except in the following cases:

  • The component's Data Access property is L (Read-Only).
  • The entity's Database Behavior property is N (Not in Database).
  • The entity's Locking property is set as N (No Updates).
  • The entity is an Up entity. (The writeUp trigger is activated in this case.)
  • A form was run with the /query or /display switch.

The write trigger of an outer entity is always activated before the write or writeUp trigger of any inner entity.

Related Topics