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 |
FromGLPrefix | VARCHAR(255) | First GL Prefix in the range |
ToGLPrefix | VARCHAR(255) | Last GL Prefix in the range |
FromGLNumber | VARCHAR(255) | First GL Number in the range |
ToGLNumber | VARCHAR(255) | Last GL Number in the range |
Sign | CHAR(1) | Sign of the amount (+, - or *) |
TemplateName | VARCHAR(8) | Name of Template |
CloneName | VARCHAR(8) | Name of Clone |
Type | CHAR(1) | Base or clone Template |
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.
FromGLPrefix/ToGLPrefix and FromGLNumber/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 TemplateName/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.
Sign may be plus (+), minus (-) or a wildcard (*). The wildcard matches any sign of the amount entered in the transaction.
TemplateName is the name of the Template that is displayed when the trigger fires.
CloneName is the name of the Template clone that is displayed when the trigger fires. If the Template does not use the clone, CloneName is set to an empty string.
Type is a one-character code that marks the Template as being of the base (B) or clone (C) type.
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:
FromGLPrefix ToGLPrefix FromGLNumber ToGLNumber Sign TemplateName CloneName Type 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 |
DocName | VARCHAR(20) | Source Document name |
TemplateName | VARCHAR(8) | Name of Template |
CloneName | VARCHAR(8) | Name of Clone |
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.
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 DocName column matches the current Document. If no specific match is found, the trigger searches for the row with DocName set to the wildcard. If the search fails, the trigger does not fire.
TemplateName is the name of the Template that is displayed when the trigger fires.
CloneName is the name of the Template clone that is displayed when the trigger fires. If the Template does not use the clone, CloneName is set to an empty string.
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:
DocName TemplateName CloneName 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