generate/cbs2.gifDelivery Zone Hook (R-DLZONE.MAC) generate/enh73.jpg

Enterprise & Corporate Edition Only


 

This script files must be located in your CAPITAL program directory and must have the file name R-DLZONE.MAC.

This script is executed everytime CAPITAL needs to determine which zone to assign the orders from a sales order or back order invoice.

Entry Values

Variable

Purpose

Value1

Equals 1 if the current transaction is an invoice containing back ordered items.

Equals 2 if the current transaction is a sales order.

Orders->X

You may query the contents of the sales order file if Value1 equals 2.

Invoice->X

You may query the contents of the invoice file if Value1 equals 1.

Custrec->X

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

Return Values

If the script returns a character string this is assigned to the back order as the zone code. Only the first 8 characters of the character string are used. If you do not wish to assign any zone code return an empty character string ("").

Returning any other value will result in the script hook being ignored. Standard zone matching will then proceed as normal.

Example

* This script locates a customer user defined

* field called Cuaux000->Zone and assigns this

* code to back orders

Declare MyZone Type Character

* Since we cannot be sure that Cuaux000 is

* opened before the script is called, request

* that it be opened as a precaution

OpenTable("Cuaux000")

* Find back ordered invoices

If Value1 = 1

   If Cuaux000->(Find(Invoice->Acccode))

      MyZone := Cuaux000->Zone

      Goto GotResult

   Endif

Endif

* Find back orders from sales orders

If Value1 = 2

   If Cuaux000->(Find(Orders->Ocode))

      MyZone := Cuaux000->Zone

      Goto GotResult

   Endif

Endif

Return FALSE

* Matched result. Close Cuaux000 if opened

* by this script and return Zone code

:GotResult

CloseTable()

Return MyZone

____________________________

Related Topics:

Back Order Control Centre

Delivery Zones

Scripting Hooks

Script Programming



Help Topic Map