generate/cbs2.gif Add Assignment Hook (R-SIPADD.MAC) generate/enh73.jpg

Stock Tracing Component Only


 

The script file must be located in your CAPITAL program directory and must have the file name R-SIPADD.MAC. It is used to post validate an assignment entered into the system when the Assign Entry window is used to enter data.

Entry Values

Variable

Purpose

Focus

The assignment entered or scanned in by the user.

Snspec->Snlen

The maximum length of the assignment.

Snspec->SNtype

The assignment type code. Possible values include:

C = character

D = date

N = numeric

T = transaction

generate/notepad2.gifThis scripting hook function should always return a character string value.

Snspec->SNName

The property allotment description.

Stock->

Stock control fields of the transaction line item.

Staux000->

Stock control user fields of the transaction line item.

Return Values

This scripting hook must always return a character value. The return value must conform to the Input Formatting constrants specified for the assignment.

Description

This script hook can be used to control the formatting of data entered by an operator to ensure that it meets specific criteria and rules.

generate/notepad2.gifFor more information on stock tracing properties consult the topic: Stock Tracing Specifications.

Example #1

This scripting hook ensures that batch numbers entered by users are within a specified range:

If Snspec->SNName = "Batch No."

   If VAL(Focus) < 2000 .Or. VAL(Focus) > 5000

      Echo("Sorry, batch numbers must be between 2000-5000.")

      Return ""

   Endif

Endif

Example #2

This scripting hook ensures that serial numbers of the sequence Serial #2 start with the code ALZ if that code is not entered:

If Snspec->SNName = "Serial #2"

   If .Not. Left(Focus, 3) = "ALZ"

      Return "ALZ" + Focus

   Endif

Endif

____________________________

Related Topics:

Stock Tracing Concepts

Stock Tracing Item Allotment

Scripting Hooks

Script Programming

 



Help Topic Map