Refer to the product documentation for more information.
Code: Select all
* Prevent zero stock quantities
If .Not. ReadTranValue("NEW")
Return
Endif
Declare nMaxCount Type Number
Declare nCount Type Number
nCount := 0
nMaxCount := ReadItemValue("STOCKID", -1)
:Loop
nCount := nCount + 1
If nCount > nMaxCount
Goto End
Endif
If .Not. IsEmpty(ReadItemValue("STOCKID", nCount)) .And. IsEmpty(ReadItemValue("QTY", nCount))
Echo("Sorry, this transaction contains a product line item with a zero quantity. Please correct before you continue.",, TRUE)
Return FALSE
Endif
Goto Loop
:End
Return TRUE