function()
{
if (!validateNotBlank("efDate", "Date"))
return false;
return true;
}
function ()
{
if (isRecordNew())
{
if (getCtrlValue("efDate") == "")
return false;
}
return true;
}
function (scanText)
{
setCtrlValue("efDate", scanText);
msgBeep(sys.MsgBoxTypeQuestion);
}
Taiwan
Japan
Gizzard
U75
75/125
126/175
176/225
226/285
286/325
326/375
375+
TAN
BRUISED
BKN 75/125
BKN 126+
Gizzard
function ()
{
if (isRecordNew())
{
return false;
}
return true;
}
function()
{
if (!validateNotBlank("efBarcode", "Barcode"))
return false;
if (!validateNotBlank("cbGrade", "Grade"))
return false;
if (!validateNotBlank("cbSize", "Darn size"))
return false;
if (!isFieldUnique("efBarcode", "Barcode"))
return false;
if (frmObj.lastSize != null)
{
if (getCtrlValue("cbSize") != frmObj.lastSize)
{
var reply = msgBox("Size does not match previous record, would you like to continue to save this record?", "Size changed", sys.MsgBoxTypeWarning, sys.MsgBoxOptionYesNo);
if (reply != sys.MsgBoxResponseYes)
{
frmObj.curRecId = 0;
refreshScreen();
return false;
}
}
}
if (frmObj.lastGrade != null)
{
if (getCtrlValue("cbGrade") != frmObj.lastGrade)
{
var reply = msgBox("Grade does not match previous record, would you like to continue to save this record?", "Size changed", sys.MsgBoxTypeWarning, sys.MsgBoxOptionYesNo);
if (reply != sys.MsgBoxResponseYes)
{
frmObj.curRecId = 0;
refreshScreen();
return false;
}
}
}
frmObj.lastSize = getCtrlValue("cbSize");
frmObj.lastGrade = getCtrlValue("cbGrade");
return true;
}
function (scanText)
{
if (scanText.substring(0, 3) == "GR_")
{ // Because starts with a "GR_" we say it is a Grade.
// Strip the "GR_" and put the balance into cbGrade.
var str = scanText.substring(3, scanText.length);
//msgBox(str);
setCtrlValue("cbGrade", str);
msgBeep(sys.MsgBoxTypeQuestion);
return;
}
if (scanText.substring(0, 3) == "SZ_")
{ // Because starts with a "SZ_" we say it is a Size.
// Strip the "SZ_" and put the balance into cbSize.
var str = scanText.substring(3, scanText.length);
//msgBox(str);
setCtrlValue("cbSize", str);
msgBeep(sys.MsgBoxTypeQuestion);
return;
}
if (!validateAndSave())
{
msgBeep(sys.MsgBoxTypeWarning);
return;
}
var rs = db.openRecordset("SELECT * FROM Item WHERE DF1='" + scanText + "'");
var ri = rs.openIterator();
if (!ri.recordExists)
{
msgBox("Failed to find record.");
msgBeep(sys.MsgBoxTypeWarning);
return;
}
var headerRef = ri.valueOf("OutwardRef");
var soundDone = false;
if (headerRef != null)
{
if(headerRef != frmObj.curHeaderRecId)
{
msgBox("Record already shipped in another batch.");
msgBeep(sys.MsgBoxTypeWarning);
return;
}
else
{
msgBox("Record already scanned.");
msgBeep(sys.MsgBoxTypeWarning);
soundDone = true;
}
}
if (!moveRecord("efBarcode", scanText))
{
msgBox("Failed to findRecord");
msgBeep(sys.MsgBoxTypeWarning);
return;
}
if (!soundDone)
msgBeep(sys.MsgBoxTypeQuestion);
}
function ()
{
var dte = dteu.today();
dte.setFullYear(dte.getFullYear(), 0, 1);
return stru.padLeft((dteu.daysSince(dte) + 1).toString() + dte.getFullYear().toString().substr(2), '0', 5);
}
function ()
{
setCtrlEnabled("efBarcode", isRecordNew());
setCtrlEnabled("pbBarcode", isRecordNew());
if (getCtrlValue("efDDDYY") == "")
setCtrlValue("efDDDYY", getDDDYY());
}
function (strButtonName)
{
switch (strButtonName)
{
case "pbBarcode":
{
if (!isRecordNew())
return;
onGotScan(null, null, getCtrlValue("efBarcode"));
break;
}
case "pbDateTimeInward":
{
var fld = getFieldForCtrl("efDateTimeInward");
var dte = frmObj.form.value.valueOf(fld);
dte = frmDateTimeEdit.editDateTime(dte, frmObj.form);
setCtrlValue("efDateTimeInward", dte);
break;
}
}
}