<-- Back to Glossary Items

Object Triggers

An object trigger is used to perform automatic actions on an object based on its values or relationships to other objects.

These might include:

  • Checking if an object should be removed if certain conditions are not met.
  • Adding or removing relationships depending on conditions
  • Changing object values or security levels depending on conditions

Date triggers also exist to make adjustments based on a wheather a date is reached or surpassed.

The trigger code has similarities to the query command but is not the same as it needs to be interpreted much faster, therefore it needs to be a lot simpler. It also needs to make changes as well as requests.

Command Action
^T Relationship Type
^C Char Data 1
^H Char Data 2
^M Text Data
^F Friendly Name
^V Object Primary Value
^W Object Secondary Value
^N Object Type (0-7)
^G Object Aggregate Data
^P Object Parent Relationship Level
^L Relationship Level
^D Object Date/Time
^I Object ID
^R Object Parent ID
^K Relationship Date/Time
^Z Object Access ID
AND, OR, NOT Logical Operators
$C() Child Relationship Exists. Returns TRUE or FALSE
$P() Parent Relationship Exists. Returns TRUE or FALSE
REL_ADD() Add a New Relationship REL_ADD(^I, 9876, 1000, 5678)
REL_DEL() Delete Relationship REL_DEL(^I, 9876, 5678)
OBJ_UPD() Update Object Values OBJ_UPD(^C = 'ABC', ^H='99)
OBJ_DEL() Delete Current Object OBJ_DEL(). No Parameters
SET() Used to set special values within an object. See below.

All Trigger expressions will take the following form:-

if {expression} then {action} else {action}

The expression and action must be enclosed in curly brackets and the else clause is optional. Also, multiple expressions can be used separated by a semicolon.

The SET() command is only to be used when setting Object Markers, Object Access ID, Domains, Parent ID id Parent Level

This should be used  with great caution as real damage can be done to the database if the values are set incorrectly. 

Command Action
G Aggregate Data
Z Access ID
O All Object Domains
O1-O30 O1 to O30 references Object Domains 1 to 30
R Parent ID
P Parent Level

e.g. Use SET(O1, 1) to set Object Domain 1