TranWrite() generate/enh74c.jpg

Enterprise Edition Only


Defines the contents of a transaction to be created.

Syntax

TranWrite(cField, [<xValue]) --> lResult

Arguments

<cField> --> The field to store a value in. There are various fields that may be assigned to transactions. These are listed in the table below:

 

*

Field

Comment

 

NAME

Customer name.

Assign the value "#*#" to retrieve the customer account's default name. However, if you do this be sure to assign the account code first.

 

ADDRESS

First address line.

Assign the value "#*#" to retrieve the customer account's default address. However, if you do this be sure to assign the account code first.

 

ADDRESS2

Second address line.

Assign the value "#*#" to retrieve the customer account's default second address line. However, if you do this be sure to assign the account code first.

 

SUBURB

Suburb.

Assign the value "#*#" to retrieve the customer account's default suburb. However, if you do this be sure to assign the account code first.

 

STATE

State.

Assign the value "#*#" to retrieve the customer account's default state. However, if you do this be sure to assign the account code first.

 

POSTCODE

Postcode.

Assign the value "#*#" to retrieve the customer account's default postcode. However, if you do this be sure to assign the account code first.

 

DNAME

Delivery name.

 

DADDRESS

First delivery address line.

 

DADDRESS2

Second delivery address line.

 

DSUBURB

Delivery suburb.

 

DPOSTCODE

Delivery postcode.

 

DSTATE

Delivery state.

 

TAXNO

Tax number or exemption status if applicable.

 

OURREF

"Our Reference" field.

 

OURREF2

Second reference field.

 

OURREF3

Third reference field.

 

SHIPPED

Shipped/carrier code.

 

REFERENCE

Order number/reference field.

*

ACCOUNT

The customer account code. The maximum length is 8 characters.

 

BILLCODE

The customer account billing code. If the account you are creating the transaction for does not have a head office billing account you do not need to specify the BILLCODE.

Otherwise include this statement:

TranWrite("BILLCODE", Custrec->Cusacc)

to bill the transaction to its head office account. If this is not done the billing code will equal the transaction's account code and the transaction will be visible to this account only.

 

SALESPERSON

Salesperson code.

*

DATE

Date of transaction.

 

DATEDUE

Due date of transaction.

 

TRAN

Transaction type. Must be a character code between "1" and "8". Type 6 (payment) is not allowed. Any other transaction types also defined as payments are not allowed either.

 

EXRATE

The exchange rate.

 

JOBNO

The transaction job number.

 

CHARGE1

User defined charge #1.

 

CHARGE2

User defined charge #2.

 

CHARGE3

User defined charge #3.

*

LOCATION

You must specify a location if CAPITAL is operating in multi-location stock mode. Otherwise, this field does not need to be specified.

 

Freight

Freight.

* Denotes Required.

<xValue> --> the value to write (store in) the transaction. If this parameter is not supplied, TranWrite() can be used to inquire on the contents of an existing transaction value.

Returns

TRUE if the transaction was successfully updated with a value, otherwise FALSE.

Description

This function is used in conjunction with the Invoice Creation Hook to create transactions based on other transactions existing in the CAPITAL system. Refer to the topic: Issue Invoices found in the main CAPITAL help for more information on this subject.

This function should be called first. It is used to define the contents of an invoice transaction.

____________________________

Related Topics:

Business Function List

TranAdd()

TranCreate()



CAPITAL VISUAL BUILDER