|
BackAllocate() 
Allocates back orders pending in the Back Order
Control Centre.
Syntax
BackAllocate(<nQty>) --> nSuccess
Arguments
<nQty> --> The quantity to allocate.
This cannot exceed the quantity on order, as specified by
Borders->Qty.
Returns
A numeric code representing the result of the
action as per the following table.
|
Code
|
Meaning
|
|
0
|
Operation was completed successfully.
|
|
-1
|
A general error occurred. Refer to the error
message that appears for more information relating to the
problem.
|
|
-2
|
The Borders-> record being pointed to does not
exist.
|
|
-3
|
The Borders-> record being pointed to could
not be record locked.
|
|
-4
|
The stock record referred to by Borders-> no
longer exists.
|
Description
This function allocates the back order record
pointed to by Borders-> with the quantity specified. The tables
STOCK, BORDERS, PICKLIST must be opened before calling this
function. It is also strongly recommended that for performance
reasons the tables KITS, CONTENTS and OSTOCK also be opened before
calling this function.
For more information on allocating back orders consult
the topics relating to the Back Order Control Centre in CAPITAL's
main documentation.
This function does not allocate any related unique
stock tracing assignments.
Calling this function leave the Borders-> record
being referenced unlocked.
Example
The following example script allocates all items
held in the Back Order Control Centre:
* Force all items in
the BOCC to allocated
* regardless of
available quantities
OpenTable("Borders")
OpenTable("Stock")
OpenTable("Picklist")
OpenTable("Kits")
OpenTable("Ostock")
Borders->(GotoTop())
:Loop
If
Borders->(EOF())
Goto
End
Endif
* If order quantity
greater than allocated quantity
If
Val(Borders->Qty) > Val(Borders->Allocated)
*
Allocate difference
BackAllocate(Val(Borders->Qty)
- Val(Borders->Allocated))
Endif
Borders->(Skip())
Goto Loop
:End
CloseTable()
Echo("Done")
____________________________
Related Topics
Business
Function List
|