Hi guys, Does anyone have experience getting a li...
# suitescript
n
Hi guys, Does anyone have experience getting a list of all sublists on a record, just a list, tried this: objRecord.getSublists(); with the N/record module and the currentRecord from context in a client script. But I get "Missing a required argument: sublistId", even though the help says nothing about required arguments.. it just says "Returns all the names of all the sublists.".. what am I missing here?
b
um
what does your code look like?
Copy code
require(["N/record"], function(record) {
  console.log(record.load({ type: "salesorder", id: "946" }).getSublists());
});
works as expected
n
@battk
Copy code
var objRecord = record.load({
    type: record.Type.ITEM_FULFILLMENT,
    id: currentRecord.id,
    isDynamic: true
});

var objSublist = objRecord.getSublist();
can't really see a difference or am I blind? 😄
b
the s at the end
n
I noticed it too and was sure I changed it but obviously not because it works now.. thanks @battk 🙂