trigger writeUp

System trigger that handles processing when a new or modified occurrence of an Up entity must be written to the database.

Declaration: trigger writeUp
Applies to: Entity
Activation: Activated during store statement processing for each new or modified database occurrence of an Up entity.
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

By default, the writeUp trigger is empty, meaning that any modifications are not stored.

Caution: Placing a write statement in the writeUp trigger can have serious implications for database integrity if the DBMS in use does not support referential integrity. DBMSs which cannot handle referential integrity constraints (that is, Uniface does it for them) could modify a foreign occurrence while related occurrences still depend on the original value. Uniface does not carry out the constraint check in this case, because of your coding.

Databases that support referential integrity constraints return store errors when they detect constraint violations that are tolerated by Uniface. This is especially likely to happen if compiling the component returns a warning message indicating that an entity needed for integrity control has not been painted.

If the writeUp trigger of an Up entity contains ProcScript, the lock trigger of this entity is activated when the user modifies the Up entity. Uniface takes care of key transportation.

Trigger Activation

This trigger is activated by the ^STORE function for an Up entity inside another entity, if the Up entity has been modified.

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

  • The component's Behavior property is Limited.
  • The entity's Locking property is set as No Updates.
  • The form was run with the /query or /display switch.

Related Topics