T24 Application Development - R17
T24 Application Development - R17
You are here: Developer's Guide > T24 API > T24 Applica on Development > Overview
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 1/39
9/11/2018 T24 Application Development
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 2/39
9/11/2018 T24 Application Development
Overview
This document explains how to develop applica ons in T24.
T24 has an extensive infrastructure in place that enables the rapid development of business components. The crea on
and maintenance of T24 applica ons is based on a series of templates, which have had numerous incarna ons
throughout the life of T24. Now in its fourth itera on, this document details how applica ons are created in a step by
step process. For an understanding of the genesis of the templates, refer to the appendix “Older Templates”. This
document does not explain the process of the previous release of the templates – refer to “TemplateProgramming V3”.
T24 is based on a one to one rela onship between the data fields on the screen and the data fields in a file. The only
way to enter data into T24 is via an APPLICATION which records the data entered and stores it in an associated file, field
by field.
There are the following stereotypes:
Applica on allows the full func onality of T24: data entry, authorisa on, dele on, history restore, etc. e.g.
CUSTOMER
Display is used to simply view the data on a file maintained by the system rather than the user e.g. STMT.ENTRY
U lity allows data entry and a Verifica on func on which ini ates a process, e.g. ENQUIRY.REPORT which records
the selec on criteria for an enquiry and then on Verifica on builds a report and spools it.
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 3/39
9/11/2018 T24 Application Development
Crea ng an Applica on
Naming
The name of the applica on must be meaningful, should give some indica on as to its purpose and should be prefixed
by the product code of the applica on, where the product code should exist on EB.PRODUCT e.g.
CR.CAMPAIGN.DEFINITION, PW.ACTIVITY, etc.
Note: The file name cannot exceed 40 characters, to allow for the addi on of the company mnemonic and
the $NAU or $HIS suffix.
name CR.CAMPAIGN.OPPORTUNITY Full applica on name including the product prefix. Must be
the same as
the applica on name
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 4/39
9/11/2018 T24 Application Development
Stereotypes
There are three stereotypes to choose from depending on the type of applica on program:
Type Descrip on
Applica on Used for all standard input programs to maintain a live, unauthorised and
history file. This template is also used for type ‘U’ programs that have a live and unauthorised file
but do not have a history file.
(H or U)
Display (L) Used for the display of a 'non-inpu able / live’ file
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 5/39
9/11/2018 T24 Application Development
U lity (W) Used to allow standard input without an unauthorised file and the verify func on to execute
special procedures
The stereotype of the applica on decides which files will be created and used. There are three files that may be created:
1. The main file is the live file or authorised file and has no suffix.
2. The unauthorised file is suffixed with $NAU and holds the record as input or changed before it has been
authorised.
3. The history file is suffixed by $HIS and contains images of the record prior to each change.
The user inputs or amends data in the unauthorised file. Another user must then view the data and authorise it at which
point it is moved from the unauthorised file into the live file. The exis ng record in the live file is moved to the history
file. The infrastructure handles all the reading and wri ng of these files.
Classifica ons
There are three primary classifica ons of applica on:
Classifica on Details
INT Installa on - This covers files like COMPANY, USER, LANGUAGE, where only one version of the
file will exist regardless of the number of companies
CUS Customer - for files where the data can be shared between companies.
Primarily sta c informa on and tables.
FIN Financial - for files that hold financial level details (amounts, balances etc.)
where the data cannot be shared with other companies.
For further explana on and a full list of the classifica ons, refer to the FILE.CONTROL help text.
Value Meaning
NOD Nonstop input allowed with NS module (for apps like PGM.FILE, BATCH etc)
no NS opera on allowed
If the applica on does not allow NS there is no need to specify it as null. This allows local developments to be non-stop
if required.
Further informa on on nonstop processing can be found in the nonstop processing user guide.
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 6/39
9/11/2018 T24 Application Development
Standard APIs
Table has the following methods to define the fields:
Refer to the object documenta on for full details. Examples of usage are below, and can also be found in
the TEMPLATE.FIELDS template rou ne:
CALL Table.defineId("MESSAGE.ID", T24_String)
CALL Table.addField("TO.DAO", T24_String,"","")
CALL Table.addFieldDefinition("DISPL.APPLICATION", "1", "": FM : "Y_","")
CALL Field.setCheckFile("DEPT.ACCT.OFFICER")
CALL Table.addField("XX.MESSAGE", T24_Text,Field_Mandatory,"")
CALL Table.addField("DATE.READ", T24_Date,Field_NoInput,"")
CALL Table.addField("TO.CUSTOMER", T24_Customer, "","")
CALL Table.setAuditPosition
Field Se ngs
Each field is defined by five se ngs:
1. Field Names and Grouping
2. Field Length
3. Field Type
4. Check file
There are also corresponding variables to define the parameters for the record id. The standard APIs hide the
complexity of these items, but it is important to understand the underlying mechanism that is used in order to use the
full flexibility of the field defini ons.
When defining the arrays you must use the incremen ng variable, Z, to reference the element of the array. In this way
fields can be added later without having to renumber all the other array assignments.
The variable V is an important common variable used to hold the number of fields in the record and should be set to Z +
9 for input applica ons and Z for display only applica ons (where Z is the last field defined in the 'F' array). If the
standard APIs have been used instead of direct array manipula on, this is achieved using the Table.setAuditPosi on
method.
The F array is a dimensioned array used to define the field name associated with each field and also specifies whether
the field is a single value, mul -valued or sub-valued.
The corresponding variable for the record id is ID.F. The record id must be single valued.
NB the maximum size of the field name is 18 characters, which includes any mul -value defini ons.
Single valued fields
Each element of the array is assigned the text string to be used on the screen to label the field. This can be up to 18
alphanumeric characters and must NOT include spaces. The first two characters cannot be 'XX' e.g.
ID.F = 'CHARGE.CODE'
F(Z) = 'CHARGE.TYPE'
F(Z) = ‘XX.NARRATIVE’
Language associated mul -values allow several transla ons of the value of the field to be held on the record, the
appropriate mul -value being used according to the language code of the user. These are defined by se ng the 'F' table
element to 'XX.LL' followed by the field name, e.g.
F(Z) = ‘XX.LL.DESCRIPTION’
= 'XX<CURRENCY'
= 'XX-CHARGE.RATE'
= 'XX-LOWER.LIMIT'
= 'XX>UPPER.LIMIT'
= 'XX<CURRENCY'
= 'XX-XX<CHARGE.RATE'
= 'XX-XX-LOWER.LIMIT'
= 'XX>XX>UPPER.LIMIT'
Field Length
The 'N' array is a dimensioned array that defines the maximum and minimum length of each field.
The corresponding variable for the record id is ID.N. The element is assigned with three sub-fields separated by a “.”:
Sub-field 1
This parameter defines the maximum length that will be allowed on input for the field or for each mul - value or sub-
value if applicable, e.g.
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 8/39
9/11/2018 T24 Application Development
If the number is prefixed by 0 (e.g. 035) then leading zeroes will not be removed. If it is prefixed by a leading space then
spaces will not be trimmed; if it is not prefixed by a leading space, all leading, trailing and mul ple spaces removed.
Sub-field 2
This parameter defines the minimum length that will be allowed on input for the field or for each mul - value or sub-
value if applicable. Null, space or zero defines that the field is op onal. If the field is mandatory, this should be set to a
value of 1 (as some languages assign significant meaning to one character, and pu ng an arbitrary length is pointless)
Sub-field 3
Although this field is no longer used, the defini on is included here for completeness. Older versions of
the template defined a CHECK.FIELDS extension to do field level valida on. However, with the move to a stateless
architecture, this feature is irrelevant. Where this parameter is set to 'C' special edi ng as coded in the CHECK.FIELDS
rou ne will be performed.
Examples:
Field Type
The 'T' array is a dimensioned array that defines addi onal edi ng to be carried out when data is input in the fields.
The corresponding variable for the record id is ID.T.
Each element consists of a dynamic array. The first field iden fies the name of the rou ne to call to perform specific
edi ng for on data input. Fields 3, 4 and 5 are used to define display masks, input restric ons and display jus fica on
respec vely. The other fields define parameters, which are used in ways specific to the par cular valida on subrou ne
and are described later in this sec on. The use of Fields 1, 3, 4 and 5 are described here:
Field 1 – Rou ne Name
Each rou ne is named 'IN2suffix'. This field contains 'suffix', and may be blank to invoke IN2.
Below is a summary table of the so-called “IN2 rou nes” that are available in T24. For more complete details refer to
the IN2 Rou nes User Guide.
Type Rou ne
Alphabe c IN2AAA,IN2SSS
Alphanumeric IN2A,IN2AA,IN2S,IN2SS
Amount IN2AMT
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 9/39
9/11/2018 T24 Application Development
Date IN2D,IN2.ACCD,IN2.CCYD,IN2.D,IN2YM,IN2.YM,IN2FQU
Frequency IN2FQU
Mnemonic IN2MME
Range IN2
Rate IN2R
Security IN2SEC
Version IN2PV
Field 3
Defines input restric ons and can be any of the following values:
Value Descrip on
Null Input will be accepted in all circumstances (subject to edi ng and security restric ons
etc.).
NOCHANGE Input will not be allowed once the record has been authorised
EXTERN Input will never be allowed and the field will be cleared by the copy func on
Field 4
This field is used to define a mask for input and display edi ng. The format of the mask is generally as used by the BASIC
func on FMT. A special mask is used by rou nes that edit dates (see the sec on describing these par cular IN2
rou nes).
Field 5
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 10/39
9/11/2018 T24 Application Development
Defines the display jus fica on, Null = Le jus fied, R = Right jus fied.
Field 7
Fields to be deleted when containing default figures a er input of this fieldVM = Field marker when more than one field
defined
Field 8
Defines restric ons on mul value fields. If used, the se ngs should be specified for the first field in the associa on and
may be set to the following values:
'NOMODIFY' - No changes allowed to associa on
'NODELETE' - No dele on allowed to associa on
'NOEXPAND' - No expansion allowed to associa on
Field 9
'Hot Field' proper es for browser:
'HOT.FIELD' – Check field valida on will be performed on this field
'HOT.VALIDATE' – Check field valida on will be performed on ALL fields (equiv. to pressing browser 'Validate'
bu on)
Virtual Tables
The concept of virtual tables has been added to prevent the growth in the number of simple tables that are shipped as
part of T24 which serve only to provide a list of op ons that Temenos cannot hard code, e.g. statuses, tles, etc.
Rather than create a new table for each of these, a virtual table can be defined.
VIRTUAL.TABLE.LIST = ''
VIRTUAL.TABLE.LIST = 'VIRTUAL.TABLE'
CALL EB.LOOKUP.LIST(VIRTUAL.TABLE.LIST)
The variable VIRTUAL.TABLE.LIST can then be used to directly populate the T array directly:
T(Z) = VIRTUAL.TABLE.LIST; * List from EB.LOOKUP
The actual items for the virtual table are defined on one table, called EB.LOOKUP. The key to this table is
VIRTUAL.TABLE.NAME*REAL.KEY, e.g. EB.STATUS*COMPLETE.
The list populates the second field of the T array, such that a list of the available op ons is available to the user without
need to use a dropdown. EB.LOOKUP contains addi onal fields in a name – value pair structure that may be used to
contain parameter informa on. Refer to the help text on EB.LOOKUP for more informa on.
Opera ons
Provision has been added to allow OPERATION style fields to be defined. The concept is that a trigger field is used to
determine the ac on that is being performed, and depending upon that ac on certain fields in the applica on will be
made available for input while others will become no input. This concept has existed in T24 applica ons for some me
(e.g. in the LC and PD modules) and now support has been added to the template.
Firstly, a field must be defined that holds the op ons, and should be named OPERATION
Z+=1 ; F(Z) = "OPERATION" ; N(Z) = "35" ; T(Z) = "" ; T(Z)<2> = 'ACCEPT_REJECT'
The property Table.Trigger is used to store which field will act as the trigger for the opera on process, and should be set
to the equated field name:
Table.Trigger = MY.APP.OPERATION
There are two further proper es that are used to control which fields will be made available for input, and which fields
will be set to no input. Each property takes a value mark (VM) delimited list of fields.
ACCEPT.FIELDS.NOINPUT = MY.APP.REJECT.DATE : VM : MY.APP.
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 11/39
9/11/2018 T24 Application Development
REJECT.REASON REJECT.FIELDS.INPUT = MY.APP.REJECT.DATE : VM :
MY.APP.REJECT.REASON
accept = 1
reject = 2
Table.inputtableFields<reject> = REJECT.FIELDS.INPUT
Table.noInputFields<accept> = ACCEPT.FIELDS.NOINPUT
In the above example, the fields REJECT.DATE and REJECT.REASON will be no input when the ACCEPT opera on is
selected – all other fields will behave as defined in the T array. When the REJECT opera on is selected, only the
REJECT.DATE and REJECT.REASON fields will be available for input – all others will no input. If both proper es are set for
an opera on, the C_NOINPUTS property is ignored. NB If we are processing a NOINPUTS list, then any field that is
already defined as NOINPUT, NOCHANGE, etc. will retain that defini on to prevent reserved fields, etc. being made
inpu able! The variables accept and reject refer to posi ons in the list of allowed opera ons (T(Z)<2>).
CHECKFILE Array
This array is a dimensioned array that defines file look-ups to be performed when data is input. The corresponding
variable for the id is ID.CHECKFILE. For new applica ons, the API Field.setCheckFile should be used, and the informa on
here is for reference to older applica ons built before the new APIs were available. As such, DO NOT use the CHECKFILE
array for new applica ons.
The check file processing will validate the input as having an exis ng record on the file and will also retrieve the
specified field of that record which is then displayed as enrichment next to the entered field. The elements of the check
file table are a dynamic array that is set up as follows:
Field 1
The applica on name of the file to be checked, e.g. CUSTOMER.
Field 2
The number of the field to be returned as enrichment or to be used as the id for the next file read. This
MUST be a file name defined in the corresponding file layout for the check file.
Field 3
This field is used to define 4 op onal parameters. These are separated by '.' and should be assigned as follows:
Subfields 1, 2 and 3
Null. These subfields are not used.
Subfield 4
'D' The id is date associated and the record with the most recent date should be used. The date is in
YYYYMMDD format.
'YM' As for 'D' but the date is in YYYYMM format.
null =No date used.
Example
To encourage re-use, check file defini ons for tables should be defined in the ini alise sec on of the .FIELDS and then
referenced later.
CHK.ACCOUNT = "ACCOUNT": FM : AC.SHORT.TITLE: FM :"L"
CHECKFILE(Z) = CHK.ACCOUNT
Standard Fields
All new applica ons MUST define a set of reserved fields that can be used to add extra fields to the applica on without
the need to change the layout of the data. You should add ten reserved fields, the names of which should be
RESERVED.1 etc. The standard API for this is:
Table.addReservedField(fieldname)
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 12/39
9/11/2018 T24 Application Development
All applica ons MUST contain a LOCAL.REF field. This allows T24 clients to add user definable fields to the applica on.
The standard API for this is:
Table.addLocalReferenceField
All applica ons MUST have a field to store overrides. Even if your applica on does not currently use the override
processing (refer to the “Adding Business Logic” sec on), it is probable that it will in the future. The standard API for this
is:
Table.addOverrideField
Applica ons that raise accoun ng entries MUST define a field to hold the entry ids that have been raised. This MUST be
the last field that you define. The standard API for this is:
Table.addStatementNumbersField
Applica ons that raise delivery events must define a field to hold the delivery references. By default, the name of this
field should be DELIVERY.REF, though you may need to have mul ple fields to hold delivery references for mul ple
involved par es. The standard API for this is:
Table.addDeliveryReferenceField
Refer to the Table API documenta on for further details on the APIs to add these standard fields.
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 13/39
9/11/2018 T24 Application Development
* A text box
CALL Table.addField("TEXT", T24_Text, "", "")
* Limited options
CALL Table.addYesNoField("YES.OR.NO", "", "")
CALL Table.addOptionsField("LIST", "OPTION1_OPTION2_OPTION3", "", "")
* CUSTOMER field
CALL Table.addField("CUSTOMER.NO", T24_Customer, "", "")
* Account field
CALL Table.addField("ACCOUNT.NO", T24_Account, "", "")
* Currency field
CALL Table.addField("CURRENCY", T24_String, "", "") CALL
Field.setCheckFile('CURRENCY')
* Category field
CALL Table.addField("CATEGORY", T24_Numeric, "", "") CALL
Field.setCheckFile('CATEGORY')
*-----------------------------------------------------------------------------
* Example block of reserved fields
*-----------------------------------------------------------------------------
Z=0
*A standard numeric field
Z+=1 ; F(Z) = "NUMERIC" ; N(Z) = "35" ; T(Z) = ""
*Alpha numeric. See also AA, AAA, S, SS & SSS Z+=1 ; F(Z) = "ALPHA" ; N(Z) = "35"
; T(Z) = "A"
* A text box
Z+=1 ; F(Z) = "XX.TEXT" ; N(Z) = "35" ; T(Z) = "A" ; T(Z)<7> = 'TEXT'
* Limited options
Z+=1 ; F(Z) = "LIST" ; N(Z) = "35" ; T(Z) = "" ; T(Z)<2> =
'OPTION1_OPTION2_OPTION3'
* CUSTOMER field
Z+=1 ; F(Z) = "CUSTOMER" ; N(Z) = "35" ; T(Z) = "CUS" ; CHECKFILE(Z) =
CHK.CUSTOMER
* Account field
Z+=1 ; F(Z) = "ACCOUNT" ; N(Z) = "35" ; T(Z) = "ACC" ; CHECKFILE(Z) = CHK.ACCOUNT
* Currency field
Z+=1 ; F(Z) = "CURRENCY" ; N(Z) = "35" ; T(Z) = "CCY" ; CHECKFILE(Z) =
CHK.CURRENCY
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 15/39
9/11/2018 T24 Application Development
* Category field
Z+=1 ; F(Z) = "CATEGORY" ; N(Z) = "35" ; T(Z) = "" ; CHECKFILE(Z) = CHK.CATEGORY
* Delivery Ref field
Z+=1 ; F(Z) = "XX.DELIVERY.REF" ; N(Z) = "35" ; T(Z) = "" ; T(Z)<3> = 'NOINPUT'
*-----------------------------------------------------------------------------
* Example block of reserved fields
*-----------------------------------------------------------------------------
Z+=1 ; F(Z) = "RESERVED.10" ; N(Z) = "35" ; T(Z) = "" ; T(Z)<3> = 'NOINPUT' Z+=1
; F(Z) = "RESERVED.1" ; N(Z) = "35" ; T(Z) = "" ; T(Z)<3> = 'NOINPUT'
*-----------------------------------------------------------------------------
Z+=1 ; F(Z) = "XX.LOCAL.REF" ; N(Z) = "35" ; T(Z) = "A"
Z+=1 ; F(Z) = "XX.OVERRIDE" ; N(Z) = "35" ; T(Z) = "" ; T(Z)<3> = 'NOINPUT'
*-----------------------------------------------------------------------------
Z+=1 ; F(Z) = "XX.STMT.NOS" ; N(Z) = "35" ; T(Z) = ""
*-----------------------------------------------------------------------------
V = Z + 9
PGM.FILE Creates a PGM.FILE record based on the informa on set in the proper es array
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 16/39
9/11/2018 T24 Application Development
CREATE.FILE Createsthephysicaldatabasefilesusing
EBS.CREATE.FILES
If Table.equatePrefix is defined, then an EB.SYSTEM.ID record will be created if one does not already exist.
Note: Once created these artefacts are s ll required to be shipped with your code. EB.DEV.HELPER merely
aids the developer in crea ng the items.
Check id ID
Overrides OVERRIDES
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 17/39
9/11/2018 T24 Application Development
You MUST write a .FIELDS rou ne for the field defini ons
For type W applica ons, you MUST write a .RUN rou ne
APPL.ID = FIELD(ID.NEW,',',1)
CALL IN2PV(ID.N,"PV":FM:"HULWD"); * should be a valid version or
application
*
* if its not a valid version or application then it should be 'SYSTEM'
*
END
Note: At this point the record has not been read. Any valida on that requires the record
Also, allows you to block a func on given the state of a record, e.g. don’t allow input once a payment has been made.
Again, control this by se ng E.
It is possible to modify the N and T arrays of the applica on in this sec on (for instance to make certain fields
no-input based on certain criteria) however this is not recommended. Instead, consider using NOCHANGE
fields and / or the trigger field func onality.
Valida on (.VALIDATE)
This sec on will be performed only when func on key F5 has been entered and V$FUNCTION is 'I' or 'C'. This should
contain all the code required to fully validate the record being input or changed. R.NEW will contain the record as input
or amended during the current transac on, R.NEW.LAST will hold the record as it was before any input or changes were
made and R.OLD will contain the record as it currently stands on the live file.
Fields in error can be flagged with a corresponding error message by calling STORE.END.ERROR with AF, AV and AS set to
define the offending field and ETEXT to the message, a key to the EB.ERROR applica on. The sec on would normally
process all the fields of the record so that the user can see all errors in one a empt.
However, some cross-valida on will make it fu le checking further fields if related fields are in error. The decision on
how to handle the cross-valida on must depend on the par cular applica on.
Be aware that this rou ne will be invoked for DELETE and REVERSE as well. Check V$FUNCTION to determine
what is being invoked.
Processing (.PROCESS)
This sec on should contain coding to perform processing which is to be done before the record is wri en to the
unauthorised file. It will be executed when V$FUNCTION is D, R, C or I and the .VALIDATE rou ne has performed
successfully. Typical use of this sec on would be to make related updates to other files, call accoun ng, etc.
Authorisa on (.AUTHORISE)
This sec on is used for any special processing required before the live record is wri en. It is normally used to invoke
accoun ng in authorisa on mode and to handle the authorisa on of a reversal.
Where there are mul ple authorisa ons, this rou ne will be called mul ple mes. This rou ne is also invoked
during the authorisa on of a reversal. To determine the real ac on, interrogate the RECORD.STATUS.
Introduc on
T24 applica ons have seen three previous templates. This sec on gives a brief history of these and explains some of the
older features that will be seen in applica ons based on these previous templates. For a full understanding of how
these different releases of the template work, refer to the user guides “TemplateMaintenance” and “T24 Applica on
Development R08”.
Template V 1
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 19/39
9/11/2018 T24 Application Development
The original template iden fied different sec ons and broke these out into labels, though these were accessed in a drop
down manner. Most code for an applica on was in a single subrou ne. Each new applica on is a copy of a template.
Template V 2
The structure changes such that subrou nes are used and the flow is controlled using GOSUB statements rather than
GOTOs, leading to a much easier to understand template. Each new applica on copies the template code, and
the template code itself may be modified. Most code for an applica on is s ll in a single subrou ne which leads to some
very large and complex programs. Conflicts happen when mul ple people need to work on a single piece of code.
Template V 3
Very similar to the second version, but here each extension point was wri en as a separate rou ne and templates were
issued against these. The XX.CROSSVAL template automa cally repeated check fields at the cross valida on step.
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 20/39
9/11/2018 T24 Application Development
Introduc on
The purpose of this document is to give an overview of the DAS rou nes and Inserts. Examples are included where
possible.
There is also a sec on showing what is required to add DAS to exis ng code.
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 21/39
9/11/2018 T24 Application Development
TABLE.NAME = “SC.POS.ASSET.WORK.HIS”
DAS.LIST = dasScPosAssetWorkHisIdEndsById
ARGUMENTS = “TUESDAY”
dasMode = dasReturnResults
LOOP
WHILE DAS.ID:DAS.MARK DO
REPEAT
@ROUTINE.NAME (DAS.tablename)
Implements the query defini on for all queries that can be used against the table. Used and called by DAS rou ne -
these rou nes should only be created from a template.
Parameters
Query list number , {Arguments}, {table suffix}
Details
This is created from a template.
This rou ne would not usually be called by code outside of a CALL DAS. If you want to return the query string that DAS
builds, set dasMode=dasReturnDescrip on and the select statement is returned, along with the descrip on, of the
query string in the `Query list number` parameter.
If you want to include a wildcard in your query, use dasWildcard and not ‘…’. For example
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 22/39
9/11/2018 T24 Application Development
THE.ARGS<1> : dasWildcard.
The DAS rou ne MUST include the following internal rou ne:
BUILD.DATA:
This will include a case block using a selec on of the following op ons…
MY.FIELDS
MY.OPERANDS
MY.DATA
MY.JOINS
MY.OPTIONAL
ADD.TO.CACHE = 0(default) or 1
MY.FIELDS = '@ID'
MY.OPERANDS = 'EQ'
MY.DATA = THE.ARGS<1>
MY.JOINS = 'OR'
Example
The following code displays the query string for a given query.
QUERY = dasScPosAssetWorkHisIdEndsById
ARGUMENTS = “TUESDAY”
DasMode = dasReturnDescription
dasMode = dasReturnResults
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 23/39
9/11/2018 T24 Application Development
DAS Inserts
I_DAS
Common code for all Data Access Service rou nes (used internally by DAS only).
Details
Sets up the dasAllIds / DAS$ALL.IDS equate to ‘ALL.IDS’ by including I_DAS.COMMON.
This include contains the code that is executed in all @ROUTINE.NAME (DAS.tablename) rou nes.
It first checks the cache, if not found in the cache it calls the internal @ROUTINE.NAME BUILD.DATA rou ne, then
executes its internal RUN.QUERY rou ne which invokes the external EB.QUERY.BUILDER rou ne.
If there is an error, the error is returned back in the query list.
If adding to the cache, the results are stored in DAS$CACHE (javafullname equate number+1). If caching dasAllIds then
DAS$CACHE(1) is used.
Includes the following internal rou nes:
INITIALISE
CHECK.CACHE
ADD.TO.CACHE
RUN.QUERY
I_DAS.tablename
Defines the named queries that can be run against a table, this file must exist for a DAS query.
Details
Each named query must be set up as a CASE statement in @ROUTINE.NAME (DAS.tablename).
The named query must be defined in lowercase star ng with ‘das’, then each word star ng with an uppercase character.
The equate number must start from 1 and increment in steps of 1. You can not use ‘0’ as this would interfere with the
DAS$CACHE used by dasAllIds.
These includes are created from a template with a comment block preceding the equates.
If your DAS item has no named queries (only requires dasAllIds) then this MUST exist without any equate assignments.
Example
*-----------------------------------------------------------------------------
* ----------------------------------------------------------------------------
* Defines the named queries that can be issued against SC.POS.ASSET.WORK table.
*-----------------------------------------------------------------------------
EQU dasScPosAssetWorkIdEndsById TO 1
EQU dasScPosAssetWorkIdBeginsById TO 2
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 24/39
9/11/2018 T24 Application Development
I_DAS.tablename.NOTES
Defines the descrip on for each named query, this file must exist for each DAS query.
Details
These includes are created from a template with a comment block preceding the array.
If your DAS item has no named queries (only requires dasAllIds) then this MUST exist without any DAS$NOTES
assignments.
Example
*-----------------------------------------------------------------------------
*-----------------------------------------------------------------------------
* Defines the named queries that can be issued against the SC.POS.ASSET.WORK
* table.
*-----------------------------------------------------------------------------
*-----------------------------------------------------------------------------
COMMON/DAS.SC.POS.ASSET.WORK/DAS$CACHE(100),DAS$NOTES(100)
*-----------------------------------------------------------------------------
DAS$NOTES(dasScPosAssetWorkIdEndsById) = 'Records with ID ending in value, by ID'
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 25/39
9/11/2018 T24 Application Development
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 26/39
9/11/2018 T24 Application Development
Defining Queries
Defining and using op onal fields
To make a field op onal :
MY.OPTIONAL.FIELDS<n> = dasIsAnOptionalField
In your code where you call the DAS rou ne, if you don’t want to include it in the DAS rou ne..
THE.ARGS<n> = dasDoNotUseThisOptionalField
Please note that a field must of already been marked as dasIsAnOp onalField in the DAS query, otherwise
dasDoNotUseThisOp onalField will be ignored. This is to ensure that the logic behind the query is not broken (joins etc).
Brackets
DAS can handle brackets (and will warn you if there is a mismatch on closing or opening brackets), to include a bracket
just prefix it to the field and suffix toe closing bracket to the data.
MY.FIELDS<1> = '(FIELD.A'
MY.FIELDS<2> = 'FIELD.B'
If all the above were op onal, the brackets would be inserted correctly as required for any combina on.
If X3 was not used then X4 would use OR to join, (X1 OR X2) OR X4, this is because DAS uses the previous fields join.
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 27/39
9/11/2018 T24 Application Development
Side notes
Use an alterna ve table
THE.LIST<2> = ’ALTERNATIVE.TABLE’
(A DAS program name which reflects the func onality should be used in the DAS rou ne)
Caching
If TABLE.SUFFIX, MY.FIELDS, MY.OPERANDS, MY.DATA, MY.JOINS or MY.SORT contain data, no caching will be performed.
THE.ARGS = ‘123.’
CALL DAS
In DAS….
MY.DATA=THE.ARGS<1> : dasWildcard
Will produce SELECT file WITH field LIKE '123'.... the query will run with the last 3 dots as the wildcard.
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 28/39
9/11/2018 T24 Application Development
Examples
DAS
Example 1: A minimal DAS item that only processes dasAllIds, areas highlighted would need to be amended for your
DAS item. Remember you will need I_DAS.tablename and I_DAS.tablename.NOTES created from the template.
*----------------------------------------------------------------------
-------
*----------------------------------------------------------------------
-------
$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_DAS.RELATION
$INSERT I_DAS.RELATION.NOTES
$INSERT I_DAS
*----------------------------------------------------------------------
-------
BUILD.DATA:
***
BEGIN CASE
CASE OTHERWISE
ERROR.MSG = 'UNKNOWN.QUERY'
END CASE
RETURN
*** </region>
*----------------------------------------------------------------------
-------
Example 2: A simple query has been added (defined in I_DAS.tablename AND I_DAS.tablename.NOTES) to the above
code as highlighted below. Note the order of the variables which makes it easier to read.
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 29/39
9/11/2018 T24 Application Development
*----------------------------------------------------------------------
-------
*----------------------------------------------------------------------
-------
$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_DAS.RELATION
$INSERT I_DAS.RELATION.NOTES
$INSERT I_DAS
*----------------------------------------------------------------------
-------
BUILD.DATA:
***
BEGIN CASE
MY.FIELDS = "REVERSE.RELATION"
MY.OPERANDS = "EQ"
MY.DATA = THE.ARGS<1>
CASE OTHERWISE
ERROR.MSG = 'UNKNOWN.QUERY'
END CASE
RETURN
*** </region>
*----------------------------------------------------------------------
-------
Example 3: Another query has been added that checks two fields to the above code as highlighted below.
Ensure that you have MY.JOINS when you have 2 or more fields.
Remember to add the query name to I_DAS.tablename and I_DAS.tabelname.NOTES.
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 30/39
9/11/2018 T24 Application Development
*----------------------------------------------------------------------
-------
*----------------------------------------------------------------------
-------
$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_DAS.RELATION
$INSERT I_DAS.RELATION.NOTES
$INSERT I_DAS
*----------------------------------------------------------------------
-------
BUILD.DATA:
***
BEGIN CASE
MY.FIELDS = "REVERSE.RELATION"
MY.OPERANDS = "EQ"
MY.DATA = THE.ARGS<1>
MY.JOINS = "AND"
CASE OTHERWISE
ERROR.MSG = 'UNKNOWN.QUERY'
END CASE
RETURN
*** </region>
*----------------------------------------------------------------------
-------
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 31/39
9/11/2018 T24 Application Development
New applica ons with accounts, local currency amount fields or exchange rate fields need to be defined in the EURO
module. Refer to the Euro manual for details.
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 32/39
9/11/2018 T24 Application Development
The Infrastructure
Introduc on
The T24 infrastructure provides many features so that the developer does not need to write or even consider these
items. This sec on gives an overview of these features.
Screen Management
One of the most important aspects of the infrastructure is its screen management capability. Once the applica on has
defined the input fields for the transac on, the infrastructure will present a standard screen for input, display,
authorisa on, history comparison etc. It will also handle field posi oning, page manipula on, data forma ng, input
enrichment etc. which means that whilst the applica ons may differ drama cally, the user will always be presented with
a standard mechanism for entry or data manipula on. However, this does not mean that the user is constrained to one
design of entry screen. The infrastructure also allows a 'version' of the screen to be defined without any coding changes
necessary at the applica on end (see the Version System Administra on Guide). The data is presented both in ‘classic’
text based screens and in T24 Browser: neither type of display requires modifica ons to the applica on program.
Security Management
The infrastructure provides two important aspects of security management, Access restric on and Ac vity logging.
System access can be controlled on four levels: system sign-on (including me restric ons), entry to applica ons and
data records, restric ng func onality (e.g. allowing display only) and defining the field values with can be entered (e.g.
amount < 10,000).
Logging can be specified from simply recording sign on/off mes to recording every access the user makes.
The applica on program requires no special code to achieve this func onality. See the Security Management System
Administra on Guide for more details.
Valida on
Input valida on can be specified with the field defini ons and hence the infrastructure will check the data entered. The
valida on available is comprehensive, offering simple checks such as numeric/non-numeric input, to complicated date
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 33/39
9/11/2018 T24 Application Development
and amount edit checks. Input can also be verified against an exis ng table as well as being passed to an applica on
specific rou ne.
To allow maximum flexibility, the infrastructure can pass control back to the applica on for further valida on at any
stage. The template also contains sec ons for further valida on on comple on of input (cross-valida on), authorisa on,
dele on etc.
History Maintenance
As an extension of the main file update procedure, the infrastructure will op onally maintain a history of all changes
made to the applica on records. The user will then have the ability to 'walk through' the history file examining every
change as it occurred and even restore the last record from history in the case of accidental reversal.
Recovery and transac on management is provided by the T24 infrastructure. Special coding is not required.
The recovery system is based on jBASE transac on management. The physical updates to the database files do not take
place un l the end of the transac on, i.e. a er the commit transac on is performed.
It is possible to use the JOURNAL file to store informa on pertaining to all the writes that occur during transac ons
input. By default this informa on is not captured and has to be setup by using the SPF applica on and se ng the field
INFO.JOURNAL to Y.
To roll back logically within a transac on, due to a program bug or operator override, the procedure has to abort the
current transac on and return to the start of the transac on (id input or whatever). This is possible because no updates
have actually taken place.
Another advantage of this mechanism is any applica on errors that cause a program to abort and would normally
involve a system restore/roll forward, can be ignored in terms of data integrity.
Refer to “Backup, Restore and Recovery System Administra on” guide.
Audit Trail
All main file updates are 'stamped' by the infrastructure with the name of the inpu er and authoriser, date- me,
terminal number, company code etc. to provide a comprehensive audit trail. If history is maintained then the audit trail
will be carried in the history records as well, providing a log of every update performed.
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 34/39
9/11/2018 T24 Application Development
Appendices
Appendix 1 - Glossary
Term Descrip on
Domain Defines areas of business func onality, e.g. Retail, Treasury, etc.
Product A specific piece of business func onality within a domain, e.g. Funds
Transfer, Foreign Exchange. Domains are made of mul ple Products
Applica on A program or subrou ne that allows data entry into a T24 file, e.g.
CUSTOMER, FOREX etc. Products will consist of many applica ons.
Subrou ne A rou ne invoked by an applica on program or close of business process, i.e. not directly
executable by the user.
Infrastructure The main suppor ng sub-system for an applica on. It manages screen
input, security (SMS), file updates etc.
History file The file which contains copies of previously authorised data.
Concat file A file which is used as an alternate index to a live file. These should
not be used unless there is a specific reason why an index would not be suitable.
FILE.CONTROL
FILE.CONTROL acts as the registry for tables for T24. Refer to helptext for further informa on.
PGM.FILE
PGM.FILE acts as the registry for applica ons and programs in T24. Refer to the helptext for more informa on.
STANDARD.SELECTION
STANDARD.SELECTION is the dic onary applica on for T24 and each applica on must have an entry in
STANDARD.SELECTION so that the T24 framework will func on correctly.
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 35/39
9/11/2018 T24 Application Development
The STANDARD.SELECTION record can be built from the underlying code by se ng the field REBUILD.SYS.FIELDS to Y
and commi ng the record.
EB.SYSTEM.ID
EB.SYSTEM.ID is used to provide a descrip on of the SYSTEM.ID field in the accoun ng entry files, STMT.ENTRY,
CATEG.ENTRY, CONSOL.NET.TODAY and RE.CONSOL.SPEC.ENTRY.
The applica on also holds addi onal details of the underlying applica on record which was responsible for raising the
entries and is used to allow the correct drill-down in entry based enquiries.
DAS programs
Acts as an entry point for all defined queries on the table. Refer to T24 Applica on Development and Subrou ne User
Guides.
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 36/39
9/11/2018 T24 Application Development
Items with a solid blue lozenge are available for programmers to add there own code.
MATRIX.UPDATE
Sets up the internal tables and variables from the parameters assigned in the .FIELDS rou ne
RECORDID.INPUT
This rou ne handles the input of the FUNCTION to be performed (input, authorise, list etc.) and the input of the record
key. It sets MESSAGE to 'RET' if the applica on is to be exited or to 'NEW FUNCTION' if the FUNCTION has been ini ally
input or changed.
MESSAGE = RET?
If MESSAGE is set to “RET” then the applica on exits.
Prefix Set?
If a prefix is set in the proper es, EB.FORMAT.ID is invoked to validate the ID entered against the prefix. Used for
standard transac on reference style ids.
RECORD.READ
This subrou ne reads the records from the files into one or more of R.NEW, R.NEW.LAST and R.OLD, depending on the
func on being used.
Where the func on is I or A, if an unauthorised record exists it will be assigned to R.NEW and R.NEW.LAST, otherwise
the live record will be assigned to R.NEW and R.NEW.LAST, unless it is also not present, in which case the arrays will be
ini alised to nulls. R.OLD will be assigned with the live record if it exists, otherwise with nulls.
Where the func on is ‘C’, if an unauthorised record exists it will be assigned to R.NEW otherwise R.NEW will be assigned
from the live record. R.NEW.LAST and R.OLD will be set to nulls.
If the func on requires a record to be present and it is not found MESSAGE will be set to 'REPEAT'.
MATRIX.ALTER
This subrou ne does further ini alising of the internal parameters dependant on the size and infrastructure of the
record, which has been read.
Display only?
If the applica on is display only (FILE.TYPE EQ 'I') the input rou nes are used, if not the display rou nes are used. If the
applica on is for a live only file (PGM.TYPE 'L') the program will not allow input.
FIELD.DISPLAY / FIELD.MULTI.DISPLAY
FIELD.DISPLAY is used to display fields when mul ple fields per line are not specified, whereas FIELD.MULTI.INPUT is
used to display fields when mul ple fields per lines are specified.
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 37/39
9/11/2018 T24 Application Development
FIELD.INPUT / FIELD.MULTI.INPUT
FIELD.INPUT processes all field input when no mul ple fields per line are defined by VERSION, whereas
FIELD.MULTI.INPUT is used when the screen has been defined as mul ple fields per line by means of a VERSION.
UNAUTH.RECORD.WRITE
This system rou ne writes the input or changed record to the unauthorised ($NAU) file.
AUTH.RECORD.WRITE
This system rou ne writes the input or changed record to the live file.
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 38/39
9/11/2018 T24 Application Development
file:///D:/T24/R17-documentation/R17AMR_ClientDocumentation/R17AMR/R17ID.htm#../Subsystems/R17PrgStd/Content/API%20Dev/T24%20… 39/39