Hi! Seeking for help on my script. my goal is to u...
# suitescript
j
Hi! Seeking for help on my script. my goal is to update my serial number record(will add additional info) upon creation of the item receipt. i have create a search to lookup the internal id of the serial number but i'm receiving an error load missing required argument type wherein i used this..
var search_serial_details = common.searchRecords('transaction',
[
["internalid","anyof",transformId],
"AND",
"itemnumber.internalidnumber","greaterthan","0"],
"AND",
["inventorydetail.quantity","greaterthan","0"]
],
[
search.createColumn({name: "item", label: "Item"}),
search.createColumn({name: "inventorynumber",join: "itemNumber",label: "Number"}),
search.createColumn({name: "internalid",join: "itemNumber",label: "Internal ID"}),
search.createColumn({name: "quantity",join: "inventoryDetail",label: "Quantity"})
]
);
if(search_serial_details.length>0)
{
var object_serial = [];
for(var x=0; x<search_serial_details.length;x++){
var serialrec = record.load('inventorynumber',search_serial_details[x].getValue({name: "internalid",join: "itemNumber",label: "Internal ID"}));
}
}
b
First step is to find the line causing the problem
Usually you get that from the stack trace from the error
Which line is causing the error
j
SSS_MISSING_REQD_ARGUMENT : load: Missing a required argument: type
this is the return error upon loading the record via script.
but I used record.load('inventorynumber',id)
may i know if we can normally load the inventory number record via console?
b
thats not how record.load works
your error message is going to be represented by an object with multiple keys
one of which has the stack
for example, the stack on this error will tell you that line 12 of suitelet.js is causing the problem
j
i see. thanks for the advice.