generate/cbs2.gif Transaction Set Department Hook (R-DEPSET.MAC) generate/en72.jpg


 

The script file must be located in your CAPITAL program directory or company subdirectory and must have the file name R-DEPSET.MAC

Entry Values

Mode Variable

Transaction

0

Invoices

1

Purchase orders

2

Sales orders

3

Stock returns

4

Quotations

5

Requisitions

6

Stock receipts

7

Stock Transfers

Return Values

A two element array value containing an 8 character location code and an 8 character department code. If any other value is returned, the return value is ignored.

generate/notepad2.gifIf an Asterisk (*) character is returned for either element, the default location or department code is returned in its place. For example, if you return the value "*" and the default location is 3, then "3" replaces "*" when the department of the transaction is set. This is useful when you wish to set only one of the above codes, or set them to a special value under certain circumstances.

Comments

This hook is called when a new transaction is first initialized. This occurs when a transaction is first opened or a transaction is saved and a new transaction opened again.

Example

* Set the transaction location to 1 and the Department

* to NSW

Return { "1", "NSW" }

____________________________

Related Topics:

Departments

Scripting Hooks

Script Programming



Help Topic Map