User's Reference > Administration > Administration from Reality > Command Reference > C > CREATE-TRIGGER

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

Reality V15.0 ()

CREATE-TRIGGER command (m605006+createtrigger.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

CREATE-TRIGGER

Associates a trigger with a Reality file.

Syntax

CREATE-TRIGGER file-specifier trigger-name trigger-type

Syntax Elements

file-specifier is the name of the file with which the trigger will be associated. This can be a file data section, a file dictionary or an account's master dictionary.

trigger-name The name of the trigger subroutine. This must be a cataloged DataBasic subroutine in the MD of the account containing the file.

trigger-type The type of trigger - one of the following:

WRITE or PRE-WRITE
Run the trigger routine before writing a file item.

POST-WRITE
Run the trigger routine after writing a file item.

DELETEor PRE-DELETE
Run the trigger routine before deleting an item from the file.

POST-DELETE
Run the trigger routine after deleting an item from the file.

Restrictions

Requires SYS2 privileges.

Comments

The file specified may be a local file (dictionary or data section) or the master dictionary of an account. You cannot specify a Q-pointer.

When associating a new trigger with a file, any existing trigger of the specified type must first be deleted (see DELETE-TRIGGER).

Example

:CREATE-TRIGGER TF TRIG1 PRE-WRITE
[1901] 'PRE-WRITE' trigger added to file 'TF'.

See Also

DELETE-TRIGGER, LIST-TRIGGERS.

RealityV15.0Comment on this topic