Transaction Template Triggers
General structure
Transaction Templates are invoked by the Transaction Data Entry application dynamically, during the data entry. What Template will be displayed depends on the GL account, sign of the Amount and the Source Document used for the given transaction. These parameters, known as triggers, are set in the Transaction Template editor and stored in two tables described in the following sections.
Account Trigger table
Information on the account triggers is stored in table SF_SYSSpecialGL of the following structure:
Column | Generalized data type | Use |
SF_FromGLPrefix | VARCHAR(255) | First GL Prefix in the range |
SF_ToGLPrefix | VARCHAR(255) | Last GL Prefix in the range |
SF_FromGLNumber | VARCHAR(255) | First GL Number in the range |
SF_ToGLNumber | VARCHAR(255) | Last GL Number in the range |
SF_Sign | CHAR(1) | Sign of the amount (+, - or *) |
SF_TemplateName | VARCHAR(8) | Name of Template |
SF_CloneName | VARCHAR(8) | Name of Clone |
SF_Type | CHAR(1) | Base or clone Template |
SF_Sequence | SMALLINT | Order of the trigger in the list |
SF_TimeStamp | SMALLINT | Version of the row (incremented with each update) |
Notes:
The table contains one row for each trigger that brings up the Transaction Template.
SF_FromGLPrefix/SF_ToGLPrefix and SF_FromGLNumber/SF_ToGLNumber set the range of GL accounts that cause the Template to be displayed. When the user enters the GL prefix and number that fall within the range, Transaction Data Entry application checks other triggering conditions (sign of the amount and the Source Document used) and if a row that meets all triggering criteria is found, the Template defined by the SF_TemplateName/SF_CloneName columns is brought into the window in place of the currently used one.
The prefix/number range columns may contain wildcards (*). The wildcards check out as a match for any GL prefix and number.
SF_Sign may be plus (+), minus (-) or a wildcard (*). The wildcard matches any sign of the amount entered in the transaction.
SF_TemplateName is the name of the Template that is displayed when the trigger fires.
SF_CloneName is the name of the Template clone that is displayed when the trigger fires. If the Template does not use the clone, SF_CloneName is set to an empty string.
SF_Type is a one-character code that marks the Template as being of the base (B) or clone (C) type.
SF_Sequence keeps track of the order of trigger in the list of triggers that display the same Template.
The following is a partial sample of contents of SF_SYSSpecialGL table:
SF_FromGLPrefix SF_ToGLPrefix SF_FromGLNumber SF_ToGLNumber SF_Sign SF_TemplateName SF_CloneName SF_Type SF_Sequence
--------------- ------------- --------------- ------------- ------- --------------- ------------ ------- -----------
10 10 330 330 * AP APadj C 0
10 10 113 113 - AR ARPAY C 0
30 34 600 600 * Rentals 0
* * 831 831 * MiscCom 0
* * 925 925 * MiscCom 1
* * 935 935 * MiscCom 2
* * 950 950 * MiscCom 3
* * 975 975 * MiscCom 4
* * 985 985 * MiscCom 5
* * 995 995 * MiscCom 6
10 10 150 150 * MiscCom 7
10 10 350 350 * MiscCom 8
20 20 840 840 * MiscCom 9
10 10 900 900 * MiscCom 10
10 10 140 143 + PINVrent 0
10 10 130 133 * PINVmer 0
30 34 830 830 * Trucks 0
30 34 833 833 * Trucks 1
30 34 836 836 * Trucks 2
Source Document Trigger table
Source Document triggers are used in making a final decision of whether or not the Transaction Template selected by the account triggers will be displayed. The Source Document trigger table SF_SYSDocumentTrigger maintains the list of Templates that can be used with the given Source Document. The Template is displayed only if its name is found in the list.
SF_SYSDocumentTrigger table has the following structure:
Column | Generalized data type | Use |
SF_DocName | VARCHAR(20) | Source Document name |
SF_TemplateName | VARCHAR(8) | Name of Template |
SF_CloneName | VARCHAR(8) | Name of Clone |
SF_Type | CHAR(1) | Base or clone Template |
SF_TimeStamp | SMALLINT | Version of the row (incremented with each update) |
Notes:
The table contains one row for each Template that can be used with the given Document.
SF_DocName may contain a wildcard (*). When the account trigger selects a Template, it checks the currently used Source Document (as set in the Transaction Data Entry application) and picks the Template from the row whose SF_DocName column matches the current Document. If no specific match is found, the trigger searches for the row with SF_DocName set to the wildcard. If the search fails, the trigger does not fire.
SF_TemplateName is the name of the Template that is displayed when the trigger fires.
SF_CloneName is the name of the Template clone that is displayed when the trigger fires. If the Template does not use the clone, SF_CloneName is set to an empty string.
SF_Type is a one-character code that marks the Template as being of the base (B) or clone (C) type.
The following is a partial sample of contents of SF_SYSDocumentTrigger table:
SF_DocName SF_TemplateName SF_CloneName SF_Type
----------- --------------- ------------ -------
JE AP APadj C
DEP AR ARPAY C
JE Rentals
RINV Rentals
* MiscCom
PINV PINVrent
JE PINVCr
PINV PINVCr
SINV PINVCr
* PINVmer
* Trucks
PINV Mileage
* Utility
* WaterBOD
* Water
JE Payroll
PINV Payroll
JE AR
RINV AR
SINV AR