TraceTrackCacheHandler

Trace/Track Cache Handler

Minor Business Rule

Object Name: B3003600

Parent DLL: CMFGBASE

Location: Client/Server

Language: C

TraceTrackCacheHandler - Trace and Track Cache Handler

This function manipulates the cache used by the TraceTrack function.

The TraceTrack business function uses this handler function to populate the Trace/Track cache with 

records according to the parameters passed into Trace/Track. Once populated, applications or other 

business functions may use this handler function, to manipulate the Trace/Track cache, for example the 

records contained within the cache can be read and displayed in a grid.


The actions performed by this handler function are dictated by the value of the cCacheActionCode 

passed in with this business function's data structure D3003600. Valid choices for cCacheActionCode are as 

follows:


'1' - add - Add the record given in D3003600 to the cache (see notes below).

'2' - get first - Select the first record from the cache that matches the criteria given in D3003600. 

The selected record is returned via D3003600.

'3' - get next - Select the next record from the cache that matches the criteria specified in the 

Get-First call (using cCacheActionCode value of '2', see notes below). The selected record is returned 

via D3003600.

'4' - terminate selection - Clear up the structures involved in Get-First/Get-Next. Note. This action 

need only be performed if a Get-First is performed without all the subsequent matching records being 

read from the cache with enough Get-Next's.

'5' - update - Overwrite the record that matches the criteria given in D3003600 with the full record 

specified in D3003600.

'6' - delete - Delete the record from the cache that matches the criteria given in D3003600.

'9' - terminate - Clear the cache and cleanup structures.


Notes:

Error conditions are signaled to the calling application or function with a non-zero value of 

cCacheErrorCode in D3003600.


Selections performed against the cache records may use either the primary key (mnUniqueKeyID only) or 

the secondary key (mnLevel, mnItemNum, szBranchPlant, szLot, mnDocumentNum, szDocumentType, 

szTransactionUnitOfMeasure, jdTransactionDate, cFromToFlag, mnF4111UKID and szLocation). To use the primary key 

in a selection, set the data structure field cCacheIndexToUse to '1' or to use the secondary key set 

the field cCacheIndexToUse to '2'.


To perform a full read of the cache the following steps must be peformed:


Define a GENLNG variable and set its initial value to zero. This variable will hold the data pointer 

to the cache cursor handle returned from the "get-first" call. The returned value must be passed back 

to the cache handler with subsequent "get-next" calls.

Define an EV01 variable and set its initial value to zero. This variable will hold the error code 

returned from the cache handler.

Peform a "get-first" call to the cache handler: cCacheActionCode <- '2', cReturnCacheCursorHandle <- 

'1', idCacheCursorHandle <-> GENLNG variable, cCacheErrorCode -> EV01 variable.

Do while EV01 variable = 0

Process cache record

Perform a "get-next" call to the cache handler: cCacheActionCode <- '3', cReturnCacheCursorHandle <- 

'0', idCacheCursorHandle <-> GENLNG variable, cCacheErrorCode -> EV01 variable.

Enddo

Clear the cache with a "terminate-cache" call to the cache handler: cCacheActionCode <- '9'


When the cache handler adds a record to the cache, a static integer variable is incremented and the 

value of this variable is assigned to the mnUniqueKeyID field within the cache record.


As a convenience, the cache record contains two fields for the "level" within a trace or track. The 

trace/track function assigns a numeric value to the mnLevel field. The value of this field is converted 

to a string by the cache handler and this converted value is assigned to the szLevelofIndention 

field. This allows users of the cache record to access the "level" of a cache record by using either the 

string or numeric values, depending on the intended usage.


Data Structure

D3003600 - Trace/Track Cache Handler

Parameter NameData ItemData TypeReq/OptI/O/Both
mnUniqueKeyIDUKIDMATH_NUMERICOPTNONE

This field is a unique number used to identify a record in a file.

mnLevelRLLVMATH_NUMERICOPTNONE

Used in FASTR Organizational Structure reports to indicate how many levels will be printed. Up to 99 levels below the selected Bus. Unit 
will be included in the "roll-up", but the user can select how many levels will be printed. A value of 1 will print only the selected Bus. Unit. A value 
of 2  will print the selected Bus. Unit plus its "children". A value of 3 will print the selected Bus. Unit, its "children" and its "grand-children". 
FASTR will only sort in Tree Order to 25 levels, but can report up to 100 levels total.

szLevelofIndentionINDLcharOPTNONE

A number indicating the level of a child in the relationship to its parent in a hierarchy.

mnItemNumITMMATH_NUMERICOPTNONE

An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item 
numbers (see data item XRT) to accommodate substitute item numbers, replacements, bar codes, customer numbers, supplier numbers, and 
so forth. The item numbers are as follows:   o Item Number (short) - An eight-digit, computer-assigned item number     o 2nd Item Number - The 
25-digit, free-form, user defined alphanumeric item number     o 3rd Item Number - Another 25-digit, free-form, user defined alphanumeric item 
number

szBranchPlantMCUcharOPTNONE

An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
might be a warehouse location, job, project, work center, branch, or plant. You can assign a business unit to a document, entity, or person for 
purposes of responsibility reporting. For example, the system provides reports of open accounts payable and accounts receivable by 
business unit to track equipment by responsible department. Business unit security might prevent you from viewing information about business units 
for which you have no authority.

szLotLOTcharOPTNONE

A lot is a quantity of items that you want to group together because they have similar characteristics.

mnDocumentNumDOCMATH_NUMERICOPTNONE

A number that identifies the original document, such as a voucher, invoice, or journal entry. On entry forms, you can assign the document 
number or let the system assign it using the Next Numbers program (P0002). Matching document numbers (DOCM) identify related documents 
in the Accounts Receivable and Accounts Payable systems. Examples of original and matching documents are: Accounts Payable     o 
Original document - voucher     o Matching document - payment  Accounts Receivable     o Original document - invoice     o Matching document - 
receipt  Note: In the Accounts Receivable system, the following transactions simultaneously generate original and matching documents: 
deductions, unapplied receipts, chargebacks, and drafts.

szDocumentTypeDCTcharOPTNONE

A user defined code (00/DT) that identifies the origin and purpose of the transaction.  PeopleSoft reserves several prefixes for document 
types, such as, vouchers, invoices, receipts, and timesheets. The reserved document type prefixes for codes are: P Accounts payable 
documents R Accounts receivable documents  T Time and Pay documents I Inventory documents  O Purchase order documents  S Sales order 
documents 

szTransactionUnitOfMeasureTRUMcharOPTNONE

The unit of measure you used when you entered this transaction into the system.

jdTransactionDateTRDJJDEDATEOPTNONE

The date that an order was entered into the system. This date determines which effective level the system uses for inventory pricing.

cFromToFlagFRTOcharOPTNONE

A code that indicates whether a line in a transaction is a From line or a To line. This field allows you to combine multiple existing products or 
locations into a single product or location. For example, you can create three From lines and one To line. You can also split one existing 
product or location into several new products or locations. For example, you can create one From line and two To lines. The information that is 
contained in a From transaction line is always existing item location information.

mnF4111UKIDUKIDMATH_NUMERICOPTNONE

This field is a unique number used to identify a record in a file.

szLocationLOCNcharOPTNONE

The storage location from which goods will be moved.

mnTransactionQuantityTRQTMATH_NUMERICOPTNONE

A value that represents the available quantity, which might consist of the on-hand balance minus commitments, reservations, and 
backorders. You enter this value in the Branch/Plant Constants program (P41001).

mnSupplierNumAN8MATH_NUMERICOPTNONE

A number that identifies an entry in the Address Book system, such as employee, applicant, participant, customer, supplier, tenant, or 
location.

szSupplierNameALPHcharOPTNONE

The text that names or describes an address. This 40-character alphabetic field appears on a number of forms and reports. You can enter 
dashes, commas, and other special characters, but the system cannot search on them when you use this field to search for a name.

szTransactionReferenceTREFcharOPTNONE

A reference number that provides an audit trail for specific transactions.

szTransactionExplanationTREXcharOPTNONE

Text that identifies the reason that a transaction occurred.

szLotGradeLOTGcharOPTNONE

A code that indicates the grade of a lot. The grade is used to indicate the quality of the lot. Examples include the following:    A1   Premium 
grade    A2   Secondary grade  The grade for a lot is stored in the Lot Master table (F4108).

mnLotPotencyLOTPMATH_NUMERICOPTNONE

A code that indicates the potency of the lot expressed as a percentage of active or useful material (for example, the percentage of alcohol 
in a solution). The actual potency of a lot is defined in the Lot Master table (F4108).

szSupplierLotRLOTcharOPTNONE

The supplier's lot number for the item.

mnJobnumberJOBSMATH_NUMERICOPTNONE

The job number (work station ID) which executed the particular job.

szComputerIDCTIDcharOPTNONE

cCacheActionCodeEV01charOPTNONE

An option that specifies the type of processing for an event.

cCacheIndexToUseEV01charOPTNONE

An option that specifies the type of processing for an event.

cCacheErrorCodeEV01charOPTNONE

An option that specifies the type of processing for an event.

cReturnCacheCursorHandleEV01charOPTNONE

An option that specifies the type of processing for an event.

idCacheCursorHandleGENLNGIDOPTNONE

General purpose ID variable.

cSuppressErrorMessagesEV01charOPTNONE

An option that specifies the type of processing for an event.

szErrorMessageIDDTAIcharOPTNONE

A code that identifies and defines a unit of information. It is an alphanumeric code up to 8 characters long that does not allow blanks or 
special characters such as %, &, or +. You create new data items using system codes 55-59. You cannot change the alias.

Related Functions

None

Related Tables

None