Professional Documents
Culture Documents
Version Routines: Dateof Issue Version Changes by
Version Routines: Dateof Issue Version Changes by
No part of this document may be reproduced or transmitted in any form or by any means,
electronic or mechanical, for any purpose, without the express written permission of TEMENOS Holdings NV.
Version Routines
Table of Content
Table of Content ................................................................................................................................... 2
Introduction........................................................................................................................................... 3
Version routines.................................................................................................................................... 3
Validation Routine ............................................................................................................................. 3
Input Routine..................................................................................................................................... 3
Authorization Routine ........................................................................................................................ 3
Introduction
VERSION is a standard T24 application, which allows users to create customized screens for input,
authorization, display etc. It may also be used to automate the replacement of data on records. In fact
T24 comes with many useful VERSION records for the majority of T24 applications. It is also possible
to add local sub-routines, which can be used for field, input and authorization validation. These small
programs will allow even greater customization of T24 by the user.
Version routines
There are three different types of routines that can be attached to a version. Each one of them is
attached at different levels and has a specific functionality. The three different types of version
routines available are:
Validation Routine
Input Routine
Authorization Routine
Validation Routine
These routines, as the name implies validate data entered in a particular field (it can also be used to
default values into a particular field) and is specified in the field VALIDATION.FLD in the Version
Application. These routines get invoked after a user presses the ‘TAB’ key (Return key can also be
used in case of Desktop or classical mode) in the field to which the routine has been attached. These
routines get invoked when record is committed as well.
Make entries for these routines in the PGM.FILE with the type set to ‘S’ and attach them to the field
VALIDATION.RTN in the Version. The name of the field to which this routine needs to be attached to
should be specified in the field VALIDATION.FLD.
For field level validations to work in browser the respective field should be set as HOT.FIELD in the
version.
Example 1
Create a version for the Funds Transfer application with the following fields. As soon as the Debit
Account Number is entered the appropriate currency has to get defaulted in the Currency field. Make
the Currency field a NOINPUT field.
Solution 1
Step 1
Create a version for the Funds Transfer application with the above mentioned fields. Ensure that you
make the DEBIT.CURRENCY field a ‘NOINPUT’ field.
Step 2
The requirement is to populate the Debit Currency with the currency of the account that has been
entered in the Debit Account Number field. The above requirement requires a subroutine that needs to
be attached to the field Debit Account Number in the version.
Note : All validation routines will get invoked when the record is committed as well. If the user
does not want these routines to be invoked at the committing stage, then the common
variable MESSAGE, defined in I_COMMON needs to be made use of. This is a dynamic array
that holds the current function.
Example : When the record is committed this variable would hold ‘VAL’. When a record is put
on hold, this variable would hold ‘HLD’. When a record is authorized this variable would hold
‘AUT’ etc.
Algorithm
Extract the account number entered in the field Debit Account Number
Using the account number, read the Account file
Extract the relevant Account record
From the extracted record, extract the currency of the account and display it in the field Debit Currency
in the Version.
COMI
Is a dynamic array defined in I_COMMON that contains the last entered value in any
application/version.
ID.NEW
Dynamic array that contains the id of the currently opened record. Defined in I_COMMON file.
R.NEW
It is a dimensioned array that has been defined in the file I_COMMON. It holds the copy of the
currently opened record in any application in T24. Always use ‘( )’ brackets while referring to variables
inside a dimensioned array as opposed to ‘<>” which we use for dynamic arrays. This dimensioned
array has been dimensioned to contain 500 dynamic arrays. The definition for R.NEW in the
I_COMMON file is as follows.
R.OLD
It is a dimensioned array that has been defined in the I_COMMON file. It holds a copy of an
authorized record when it is opened for amendment. The definition for R.OLD in the I_COMMON file is
as follows.
R.OLD(C$SYSDIM)
ID.OLD
Is a dynamic array that holds the id of the record held in R.OLD
R.NEW.LAST
R.NEW.LAST is a dimensioned array that will hold a copy of an unauthorized record when it is opened
for amendment. The definition for R.NEW.LAST in the I_COMMON file is as follows.
R.NEW.LAST(C$SYSDIM)
ID.NEW.LAST
Is a dynamic array that holds the id of the record held in R.NEW.LAST
HOT.FIELD
While Desktop was used as the front end for T24, all field validations would get triggered on pressing
tab or return on a particular field. With the advent of Browser as the front end, there exists a stateless
connection between the client (Browser) and T24. Hence, it would be very expensive on the system to
perform field validations for all fields. Hence, a concept called ‘hot fields’ was introduced.
When Browser is used as the front end, field level validations will take place only if the field is set as a
hot field. Defining a field as a Hot Field, automatically sends a validation request to the server on
change of data. Hot fields are shown with a next to them.
Care should be taken when defining fields as hot fields. Only fields for which field level validation is
absolutely mandatory should be defined as hot fields. T24 anyway validates all fields when the record
is committed.
To specify a field as a hot field, the version to which it belongs must be amended. The field “ATTRIBS”
should be set to “HOT.FIELD” to signify that validation should be run when this field is exited.
*Version subroutine that will populate the debit currency based on the
*Debit Account Number.
SUBROUTINE V.TRG.VAL.RTN
$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_F.ACCOUNT
$INSERT I_F.FUNDS.TRANSFER
Note : In the above example, the variable MESSAGE is checked to see if it contains the value ‘VAL’. If
it does, then it denotes that the record is being committed. This routine will hold no meaning when
invoked at the committing stage as we are extracting the value of DEBIT ACCOUNT NUMBER from
COMI. COMI will be NULL when committing a record and thus the check on the variable MESSAGE is
incorporated.
Step 3
Compile and catalogue the subroutine. Make an entry in the PGM.FILE with the type as ‘S’ and attach
it to the Validation.Rtn(prefixed with an ‘@’ symbol) in the version. Set the attributes field for Debit
account Number as Hot Field. Ensure that you specify ‘DEBIT.ACCT.NO’ in the field Validation.Fld.
Output:
Debit currency is
automatically defaulted
on pressing tab in the
field Debit.Acct.no
The symbol denotes that the field Debit Acct No is a hot field.
Input Routine
These routines as the name implies get invoked just prior to committing a transaction in the
unauthorized stage. Multiple routines can be attached at this stage. Routines called at this stage may
be used to provide additional checking or override processing. At this point of the transaction all
standard default and validation processing would have taken place.
Input routines get invoked even when the record is put on hold. Therefore, if these routines need not
be invoked when the record is put on HOLD, then use the variable MESSAGE(already discussed) and
check if the record is being committed or being put on hold and then proceed with the necessary
processing. Attach them to the field INPUT.RTN in the Version
Example 3
Create a version for the FT application in which when the user presses F5 to commit the record, a
check has to be made to see whether the Debit Account Currency and the Credit Account Currency
are the same. If not an error message “Debit and Credit Account currency mismatch”, has to be
displayed.
Solution 3
Step 1
Create a version for the FT application by name FT,INPUT with all the mandatory fields.
Step 2
Create a subroutine that will extract the Debit Account Currency and the Credit Account Currency from
the version, check if they are the same, if not flash an error message.
Algorithm
Extract the value of the Debit Currency and the Credit Currency from R.NEW, as R.NEW is the
dimensioned array that contains a copy of the currently opened record.Check if the extracted values
matches, else flash the above mentioned error message.
STORE.END.ERROR
This is a T24 subroutine that is capable of displaying an error message stored in a common variable
ETEXT. Therefore, the variable ETEXT always needs to be populated with the error message before
this subroutine is called. ETEXT has also been defined in the file I_COMMON.
In the above example, the message ‘Error Message’ would be displayed by the routine
STORE.END.ERROR.
AF, AV and AS
These are dynamic arrays defined in I_COMMON that can hold the physical field number, multi value
and sub value position (of fields) respectively. Setting these variables before calling
STORE.END.ERROR would result in the display of these error messages adjacent to the field which
caused the error.
Example
AF = 1
AV = 1
AS = 1
ETEXT = “Error”
CALL STORE.END.ERROR
Will cause the error message to be displayed adjacent to the field ‘1.1.1’.
When referring to single value fields, it would suffice if you set just AF to the physical field number.
When referring to multi value fields, it would suffice if you set AF and AV to the physical field number
and multi value position.
*Version input routine that checks if the debit and the credit currency are
*equal. Else flashes an error message
SUBROUTINE V.TRG.INP.RTN
$INSERT I_COMMON
$INSERT I_EQUATE
$INSERT I_F.FUNDS.TRANSFER
IF MESSAGE NE ‘HLD’ THEN
Y.DEBIT.CUR = R.NEW(FT.DEBIT.CURRENCY)
Y.CREDIT.CUR = R.NEW(FT.CREDIT.CURRENCY)
IF Y.DEBIT.CUR NE Y.CREDIT.CUR THEN
*Setting the position of AF to 5 so that the error
*message would be displayed adjacent to field number
*5(DEBIT.CURRENCY)
AF = FT.DEBIT.CURRENCY ; * Note that the field name has been
* used instead of field number
ETEXT = “Credit Acct Ccy Debit Not Eq Credit Ccy”
CALL STORE.END.ERROR
END
END
RETURN
END
Step 3
Compile and catalogue the subroutine and attach the subroutine to the field ‘INPUT.ROUTINE’ in the
version.
Authorization Routine
This is a routine that gets executed at the authorization stage of a transaction. Multiple routines may
be defined. Routines called at this stage may be used to update local files. At this point of the
transaction all standard default and validation processing will have taken place. This routine is invoked
after a write is made to the buffer meaning that changes made to R.NEW will not reflect in the record
unless an WRITE is made explicitly. In this case, a call to F.WRITE should not be succeeded by a call
to JOURNAL.UPDATE as this would be taken care of by T24 core. Attach them to the field AUTH.RTN
in the Version
Example 4
As a part of core T24, whenever a customer record is authorized, a record is created in the
DE.ADDRESS file. This file is used by the Delivery module in T24 and stores the address of the
customer as in the customer file. This address is used when advices need to be sent to the customer.
Where
US0010001 : Company code of the company that the customer belongs to
C-100001 : ‘C’ denotes Customer and followed by the customer id
PRINT.1 : Denotes the print carrier. Denotes that the address stored in this record should be used
when the advice is printed and mailed to the customer.
If a customer wishes to receive his advices in 2 different locations(some advices need to be sent to his
residence and some to his office address), then we would normally create an additional record in the
DE.ADDRESS file with the following id
US0010001.C-100001.PRINT.2
The PRINT.2 denotes that this is the second PRINT address of the customer.
The above mentioned process of creating an additional address record for customer needs to be
automated.
Add a new local reference field called ADDRESS.2 to the Customer application. When a new
customer record is authorised, a record should be created in DE.ADDRESS with the id
COMPANY CODE.C-CUSTOMER NO.PRINT.2. The values in the fields short name, name.1, name.2
and ADDRESS.2 (local reference field) should be written to the DE.ADDRESS record with the above
mentioned id.
Solution 4
Step 1
Create the necessary subroutine.
Algorithm
Check if the customer record being authorized is a new customer record
Form a record for the DE.ADDRESS file with the short name, name.1, name.2 (all the above
mentioned 3 fields should be extracted from the customer record being authorized.), street and town
country (get the value from the local reference field ADDRESS.2)
Form the id of the DE.ADDRESS file and write the record formed into the DE.ADDRESS file.
ID.COMPANY
This is a dynamic array that is defined in the I_COMMON file which holds the id of the current
company.
When the above piece of code is attached to a version, the supplied OFS message will get written on
to a file named F.OFS.MESSAGE.QUEUE. This is the IN queue from where the service
OFS.MESSAGE.SERVICE picks up the data and processes.
Once the message is processed, the response is written on to an out queue named
F.OFS.RESPONSE.QUEUE.
The service OFS.MESSAGE.SERVICE is a multi threaded service and needs to be started like any
other service. It also requires the tSM to be up and running.
Sample IDs:
A service named OFS.RESPONSE.QUEUE is now available in T24. This service is used to purge all
messages in F.OFS.RESPONSE.QUEUE provided they have been in the queue longer than the
number of seconds specified in the field ATTRIBUTE.VALUE in the TSA.SERVICE record for
OFS.RESPONSE.QUEUE.
Step 2
Create a version of the Customer application with all the mandatory fields, compile and catalogue the
subroutine and attach it to the version.
Step 3
Input a customer record. Sign off and sign in as another user and authorize the record using the
version to which you have attached the routine.