generate/cbs2.gif Stock Find User Column Hook (R-SFColn.MAC) generate/en72.jpg

Enterprise & Corporate Edition Only


 

This script allows you to define your own read-only columns that may appear on the Stock Find search window.

The script file must be located in your CAPITAL company data subdirectory and must have a file name including or between R-SFCOL0.MAC and R-SFCOL9.MAC. (Up to 10 user-definable columns are supported.) So R-SFCOL2.MAC, R-SFCOL5.MAC and R-SFCOL8.MAC are all valid script file names.

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 Find Column List.

2

Heading

This is the name of the column heading that appears on the Find window. 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

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.

Comments

None.

Example #1

The following script displays the stock item's weight.

Declare cScript Type Character

cScript := "Return Stock->Weight"

Return { "Weight", "Weight", 12, 2, 6, cScript }

generate/mistake1.gifR-SFColn.MAC scripts must reside in your company data directory. Do not place them in your program directory.

____________________________

Related Topics:

Scripting Hooks

Script Programming

Stock Find



Help Topic Map