copyTran Method

Class: TranSet

Description

This method builds a financial transaction in a transaction record object. Creating this object requires that:

Multiple transaction records can be created within a single process (e.g., preauthorized transfers with debit and offsetting credit transactions based on one entry in the DAYEND process). The system creates each transaction individually and copies them to a transaction set to post all transactions associated with a single day-end entry at one time. This method constructs an entry in the transaction object that looks similar to a TR array. The TTXBLD procedure defines the column references.

Syntax

transactionObject.copyTran(dbObjectName,colRefs,tranSeq,secTran)

Parameters

dbObjectName

The name of a database object (e.g., RecordTTX).

colRefs

An array keyed by TTX columns. The data of each entry contains the value to insert into the object for that column.

tranSeq

Optional transaction sequence number for the TTX record (i.e., that equates to TTX.TSEQ).

secTran

A string that identifies the transaction type for tranSeq if other than a primary transaction. Valid values are SYSTEM or SECONDARY.

Returns

Void

When Became Available

Profile v6.0

Example

type RecordTTX ttx ttx=Class.new(“RecordTTX”)

// ttx can be a variable or an array

type TranSet ts=Class.new(“TranSet”)

 

set ttx.cid = CID

set ttx.itc = ITC

set ttx.etc = ETC

set ttx.tamt = TAMT

set ttx.efd = %SystemDate

set ttx.tlo = %UserStation

set ttx.tcmt = TCMT

set ttx.cc = CC

if %MCP set ttx.crcd = CRCD

 

set ttx1 = ts.copyTran(ttx)

 

set par(“OPTION”) = 1    // System-generated

set par(“IPMODE”) = 3    // Process transactions, update database

 

do ts.postTSet(TJD,BRCD,.par)

 

 

*The variables in this example would need to be defined prior to their use.