callx (Write Trigger) Processing Code

The callx processing code is called when a record is updated in the table.

System Processors

N/A

Code Type

File Defining

Dictionary Attributes

Correlative

Syntax

callx file.spec module

Parameter(s)

file.spec

Full path to the file containing the FlashBASIC code. The full path database,file, must be used (for example dm,bp,). The account name in the file path must be an FSI account. file.spec can be omitted if the module has been cataloged in the Domain Catalog.

module

Record-ID of the FlashBASIC module.

The argument of the module is the record itself. The argument can be modified and the modified record is written to the table.

Subroutines invoked with the callx processing code are executed when an item in D3 is updated, regardless of which process does the updating. That is, the Update Processor, FlashBASIC write statement, TCL copy command, or the AQL t-load command. The entire item is passed to the subroutine.

This processing code differs from the call subroutine in that it is called any time an item in the file is updated, versus being called when the item is updated from the Update Processor. The parameter passed is the entire item, which may be updated by the subroutine. Only the following ACCESS functions are supported within a callx subroutine:

1

File variable for the data portion of the file.

2

File variable for the dictionary portion of the file.

3

Identical to the parameter upon entry to the subroutine and cannot be updated by the subroutine.

10

Item-ID and cannot be changed by the subroutine.

11

Dictionary and data filename.

NOTE— if the dict and data filenames are the same, only the data filename will be returned.

12

Returns 1 if the item is deleted.

16

Returns 1 if the item is new.

23

Always 1.

26

1 if the operation is deleting a record as part of a clearfile. Note that access(26) is writable. If set to 0, the trigger will not be called anymore for each delete item operation. This allows the trigger to inform the file system to do the clear file quickly.

27

Returns the name of the account containing the D-pointer for the file from which the BASIC program was called via a trigger or a call from a correlative.

50

Returns 1 if the item was in UNICODE.

NOTE—FlashBASIC does not currently support UNICODE therefore the item is converted to ANSI and back to UNICODE after the trigger completes.

 

NOTE

  • If a routine writes, deletes, or modifies an item in a file using a callx FlashBASIC program to validate the data and the validation fails, the item is not written to the file. This affects commands such as clear-file, delete-file, and t-load. Since the FlashBASIC write command has no then/else clause, the program cannot trap the write failure.

  • All item-locks locked via the callx subroutine will be released upon exiting the subroutine.

The callx trigger is not called on a clear file operation if there is a Clear File Trigger on the same file.

If an inputerr statement is encountered, the update does not take place. If there is a non-empty argument, a message box displays and control is not returned until a selection is made.

See Also

callx-on Command, callx-off Command, access() Function, call Processing Code, File-Defining Items, inputerr Statement, Processing Codes Overview, Processing Codes, write Statement