Code: Select all
* COBS, 14/09/2017
* Specify Mandatory Fields when saving quotes
Declare cField Type Character
Declare aRequired Type Array
Declare aError Type Array
Declare nCount Type Number
nCount := 1
aRequired := { "REFERENCE", "EMAIL", "ORDEREDBY", "QREF1", "PROMO", "ORIGIN", "CATEGORY", "PRIORITY" }
aError := { "Order Number", "Email Address", "Ordered By", "Area", "Promotional Code", "Origin Code", "Category", "Priority Level" }
:Loop
If nCount > Len(aRequired)
Return TRUE
Endif
cField := ReadTranValue(aRequired[nCount])
If IsEmpty(cField)
EchoWarn("Sorry, the input field '" + aError[nCount] + "' cannot be left blank. Please assign it a value before proceeding.")
Return FALSE
Endif
nCount := nCount + 1
Goto Loop