Bibek Shrestha
08/04/2021, 7:24 PMWave
record using SS2.1? NetSuite has recently made it available to create this record using SS.
But I am having hard time trying to figure out how to add the line items to this record.
/**
* @NApiVersion 2.1
* @NScriptType Suitelet
*/
define(["N/record", "N/render"], function (record, render) {
function onRequest(context) {
const waveRec = record.create({
type: record.Type.WAVE,
isDynamic: true,
defaultValues: {},
});
waveRec.selectNewLine({
sublistId: "lineitems",
});
waveRec.setCurrentSublistValue({
sublistId: "lineitems",
fieldId: "order",
value: "10475772",
});
waveRec.setCurrentSublistValue({
sublistId: "lineitems",
fieldId: "line",
value: "1",
});
waveRec.commitLine({
sublistId: "lineitems",
});
const waveRecId = waveRec.save();
log.debug("Wave Rec ID", waveRecId);
}
return {
onRequest: onRequest,
};
});
Craig
08/04/2021, 7:35 PMCraig
08/04/2021, 7:37 PMCraig
08/04/2021, 7:37 PMBibek Shrestha
08/04/2021, 7:39 PMUNEXPECTED_ERROR
at the line where I save the record.CD
08/04/2021, 7:56 PMBibek Shrestha
08/04/2021, 8:22 PMNetsuite Field Explorer
plugin. The sublist id is correct but the two fields line
and order
are lineNumber
and ordernumber
. I tried with these field ids too, still giving me the same error.Bibek Shrestha
08/04/2021, 8:23 PM