Hi, has anyone created `Wave` record using SS2.1? ...
# suitescript
b
Hi, has anyone created
Wave
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.
Copy code
/**
 * @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,
  };
});
c
I don't think a lot of people in this channel have used the WMS module.
Not much help but have you tried insertline() instead of selectNewLine() ?
Although I guess they should work the same way except one adds to the beginning of the list and the other at the end.
b
Ya, they seem to be similar. I just get
UNEXPECTED_ERROR
at the line where I save the record.
c
Dump an existing record to the console & make sure the list name is right?
b
I looked at the
Netsuite 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.
This is relatively new record for SS so I might contact NS support for this one.