Charles Boyer
10/07/2020, 4:05 PMdefine([ "N/record", "N/runtime"], function(r, log) {
function validateLine(scriptContext) {
var recCurrent = scriptContext.currentRecord;
var itemClosed = recCurrent.getCurrentSublistValue({
sublistId : 'item',
fieldId : 'isclosed'
});
var whyClosed = recCurrent.getCurrentSublistValue({
sublistId : 'item',
fieldId : 'custcol_reason_closed'
});
if (itemClosed && !whyClosed) {
alert("Please enter a reason for the items closed.");
return false;
}
else if (itemClosed && whyClosed) {
log.debug({details:"Item Closed" + itemClosed});
return true;
}
}
return {
validateLine : validateLine
};
});
battk
10/07/2020, 4:10 PMbattk
10/07/2020, 4:11 PMbattk
10/07/2020, 4:12 PMstalbert
10/07/2020, 4:12 PMN/runtime
module as log
which probably isn't what you want.Charles Boyer
10/07/2020, 4:12 PMstalbert
10/07/2020, 4:13 PMimport
syntax I use in TS always generates correct define() argumentsstalbert
10/07/2020, 4:14 PMSandii
10/07/2020, 4:15 PMdefine([ "N/record", "N/runtime"], function(r, log) {
, that is the problem right there. runtime.debug isnt a thing