+^Cycle(1) -commands=Set -xecute="Write ""$ZTLevel for ^Cycle(1) is: "",$ZTLevel Set ^Cycle(2)=1" +^Cycle(2) -commands=Set -xecute="Write ""$ZTLevel for ^Cycle(2) is: "",$ZTLevel Set ^Cycle(1)=1"
+^Acct("ID") -commands=set -xecute="set ^Acct(1)=$ztvalue+1" +^Acct(sub=:) -command=set -xecute="set ^X($ztvalue)=sub"
+^Acct(1,"ID") -commands=Set -xecute="Write:$ZTOLdval ""The prior value of ^Acct(1,ID) was: "",$ZTOLdval"
This trigger gets invoked with a SET and displays the prior value (if it exists) of ^Acct(1,"ID").
GTM>w ^Acct(1,"ID") 1975 GTM>s ^Acct(1,"ID")=2011 The prior value of ^Acct(1,ID) was: 1975
+^trigvn -commands=Set -pieces=1;3:6 -delim="|" -xecute="Write !,$ZTUPDATE"
GTM>write ^trigvn Window|Table|Chair|Curtain|Cushion|Air Conditioner GTM>set ^trigvn="Window|Dining Table|Chair|Vignette|Pillow|Air Conditioner" 4,5
Intrinsic Special Variable |
Within Trigger Context |
Notes |
---|---|---|
$ETRAP |
Read / Write |
Set to gtm_trigger_etrap or the empty string when entering trigger context. For more information on using the $ETRAP mechanism for handling errors during trigger execution, refer to “Error Handling during Trigger Execution”. |
$REFERENCE |
Read only |
Restored at the completion of a trigger. |
$TEST |
Read only |
Restored at the completion of a trigger. |
$TLEVEL |
Read only |
Always >=1 in trigger code; must be the same as the completion of processing a trigger as it was at the start. |
$ZTNAME |
Read only |
Returns the trigger name. |
$ZTDATA |
Read only |
Shows prior state. |
$ZTLEVEL |
Read only |
Shows trigger nesting. |
$ZTOLDVAL |
Read only |
Shows the pre-update value. |
$ZTRAP |
Read only - "" |
Must use $ETRAP in trigger code. |
$ZTRIGGEROP |
Read only |
Shows the triggering command. |
$ZTUPDATE |
Read only |
Lists modified pieces (if requested) for SET. |
$ZTVALUE |
Read / Write |
Can change the eventual applied value for SET. |
$ZTWORMHOLE |
Read / Write |
Holds application context because trigger code has no access to the local variable context. |
$ZTSLATE |
Read/ Write |
Holds outermost transaction context for chained or nested triggers. |