generate/cbs2.gif Transaction User Column Hook (R-xxCOLn.MAC) generate/en711.gif


 

This script allows you to define your own read-only columns that may appear on your transaction item input screens.

The script file may be located in your CAPITAL program directory, data root directory or company data directory, and must have a file name corresponding to one of the names in the File Table. You may define up to 10 user defined columns per transaction. The 'n' symbol in the file table must represent a number between 0 and 9. For example: R-INCOL0.MAC, R-RPCOL5.MAC and R-QUCOL9.MAC are valid column file names for invoicing, requisitions and quotations.

File Table

File Name

Purpose

R-INCOLn.MAC

Invoices and invoice related transactions.

R-TRCOLn.MAC

Stock Transfers.

R-POCOLn.MAC

Purchase orders.

R-RQCOLn.MAC

Requisitions.

R-OECOLn.MAC

Sales order entries.

R-RECOLn.MAC

Stock Returns.

R-RPCOLn.MAC

Stock Receipts.

R-QUCOLn.MAC

Quotations.

Return Values

You must return an array variable containing 6 elements. These are listed in the following table.

Column

Function

Contents

1

Description

The description of the column that will appear in the Transaction Column List. This is the list of available columns that the user can choose from when they select Customise|Column Options|Complete Column List from the transaction menu.

2

Heading

This is the name of the column heading that appears on the transaction. The heading name should be equal to or less than the width of the column, otherwise the name will probably be truncated.

3

Width

This is the width of the column in character units. This element should contain a number between 1 and 99.

4

Alignment

This element defines how the contents of the column should be aligned. The acceptable values are:

0 = left aligned

1 = center aligned

2 = right aligned

Numeric columns should normally be set to right alignment.

5

Colour

The colour of the contents of the column. This will default to black but you may specify an alternate colour if you wish.

0 = Default / Standard Colour

1 = BLACK

2 = DARK RED

3 = DARK GREEN

4 = DARK YELLOW

5 = DARK BLUE

6 = DARK MAGENTA

7 = AQUA

8 = DARK GRAY

9 = WHITE

10 = RED

11 = GREEN

12 = LIGHT YELLOW

13 = BLUE

14 = MAGENTA

15 = CYAN

16 = GRAY

6

Contents

The contents of the column to display. This is a CBS script that will be executed and its return value displayed. It should be assigned to this element as a character string. See the next section (Entry Values) for further information.

Entry Values

The column script's contents can be defined using CBS script. The following values are available to query when the script is executed.

Variable

Purpose

ReadTranValue()

You may use the ReadTranValue() function to query any of the settings of the current transaction.

Stock->X

You may query the contents of the fields of the current stock record.

Staux000->X

You may query the contents of any user fields if applicable.

Custrec->X

You may query the contents of the fields in the customer record.

Cuaux000->X

You may query the contents of any customer user fields.

Supplier->X

You may query the contents of the fields of the supplier record for the related stock item.

Suaux000->X

You may query the contents of the fields of the supplier record for the related stock item.

Comments

None.

Example #1

The following script displays the stock item's last sale date.

Declare MyColumn Type Array

MyColumn := ArrayCreate(6)

MyColumn[1] := "Last Sale Date"

MyColumn[2] := "L/Sale"

MyColumn[3] := 8

MyColumn[4] := 0

MyColumn[5] := 13

MyColumn[6] := "Stock->Lsale"

Return MyColumn

Example #2

The following script displays the stock item's discount name:

Return { "Discount Description", "Disc Name", 15, 0, 3, "SpecialName(TRUE)"

____________________________

Related Topics:

Scripting Hooks

Script Programming

Transaction Column Script Functions

Transaction Script Functions



Help Topic Map