Trigger routines

There are various generic trigger subroutines that have been written to simplify the development of applications. These subroutines are described here.

sysfiledel

sysfiledel deletes a record from a database file. The database file that the record is deleted from is indicated by the associated file on the page properties. The record that is deleted from the file is indicated by the sysid parameter (data field 0).

Delete Confirmation

If the developer would not like any confirmation to occur, then the trigger parameter must be set to "skip". If the trigger parameter is not set to "skip" then the routine assumes that there is a delete confirmation checkbox on the page. The value of this checkbox must be stored in sysreserved<3> (data field r3) and must be set to "on" for the record to be deleted from the file.

Page Parameters to be set

Associated File

 


sysfilesave

sysfilesave writes data to a record in a database file. The record id is indicated by sysid (data field 0) and the file is indicated by the associated file on the page properties. The data written to the file is stored in sysdata (data fields 1,2,3,4...9999).

Page Parameters to be set

Associated File


sysfileopen

sysfileopen reads data from a record in a database file. The record read is indicated by sysid (data field 0) and the file read is indicated by the associated file on the page properties. The data read from the file is stored in sysdata. All values in syshidden and sysreserved are cleared.

Page Parameters to be set

Associated File


sysfilenew

sysfilenew resets all the values on the page. The function clears the values in sysid, syshidden, sysdata and sysreserved.

Page Parameters to be set

Associated File


syslogon

syslogon checks the credentials of a logon request. The routine requires the username and password of the user to be passed through in the URL in variables called AuthLogonUser and AuthLogonPwd respectively. These variables are usually defined by using named text boxes. The routine checks whether the password is correct against the encoded password on the system and whether or not the password has expired. Next, it assigns the users security groups and then calls syscreate to create the startup page specified for that user.


sysmvadd

sysmvadd adds another field to the specified set of dependant elements on a page. The appended elements must all have the same dependencies as the trigger.

The difference between this routine and sysmvaddnew is that the trigger object here is also dependant on the data field and is therefore repeated with the dependant elements.

N.B. This routine can only be called from an object on a table.


sysmvaddnew

sysmvaddnew adds another field to the specified set of dependant elements on a page. The appended elements must all have the same dependencies as set in the trigger parameter.

The difference between this routine and sysmvadd is that the trigger object here does not have to be dependant itself and therefore does not have to repeat with the dependant elements.

N.B. This routine can only be called from an object on a table.


sysmvdel

sysmvdel deletes a specified field from the dependant elements on a page. The elements to be deleted and the trigger must all be dependant on the same field. This implies that the trigger must be repeated for each set of elements.

N.B. This routine can only be called from an object on a table.


sysmvins

sysmvins inserts a specified field into the dependant elements above the trigger on a page. The elements to be inserted and the trigger must all be dependant on the same field. This implies that the trigger must be repeated for each set of elements.

N.B. This routine can only be called from an object on a table.


sysnavback

sysnavback returns the last different page in the syssessions file for the current session. All data values in the common block are replaced with what they were when the returned page was submitted.


sysnavbackto

sysnavbackto returns to a specific page. The routine returns to the last instance in the syssessions file of the page defined by the objects trigger parameters. All data values in the common block are replaced with what they were when the returned page was submitted.


sysnavrefresh

sysnavrefresh repaints the current page. It recalls all the routines associated with the current page and loads the data values defined in the common block.