This topic contains 4 replies, has 2 voices, and was last updated by Adolfo Garza 6 years, 4 months ago.
-
AuthorPosts
-
July 4, 2018 at 1:20 am #19018
Hi,
We’ve recently enabled advance item location configuration which means we can no longer mass update reorder points & preferred stock level via csv or standard mass update (have also verified with NetSuite support that this is an enhancement request).
We have over 1000 items that need to be updated so we are going to go with a mass update script however when we run the below, it is throwing this error:ย <span style=”color: #222222; font-family: sans-serif; font-size: 13px;”>Cannot find function setLineItemvalue in object nlobjRecord</span>
Does anyone know what the function should be to update an inventory location line or have I got the wrong format somewhere in the script below?
function updReorderPoint(rec_type, rec_id)
{
var itemRec = nlapiLoadRecord(rec_type, rec_id)
var line = itemRec.findLineItemValue(‘locations’,’location’,1);
itemRec.setLineItemValue(‘locations’,’reorderpoint’, line, null);
itemRec.setLineItemvalue(‘locations’,’preferredstocklevel’, line, null);
nlapiSubmitRecord(itemRec);
}
Thanks!
Iris
-
July 4, 2018 at 6:06 am #19020
The code you entered in the lower section doesn’t match the error you described. The error you described says “Cannot find function setLineItemvalue in object nlobjRecord” which has “setLineItemvalue” mispelled, it should be “setLineItemValue”
-
July 4, 2018 at 6:38 pm #25506
Ah thanks Adolfo! How embarrassing. I’m new to scripting. Have fixed that up. Next challenge is trying to target the right field in the sublist as the script runs fine but the values are not being updated. have tried Null or a numeric value but it is not updating. Have also ensure auto reorder points and auto preferred stock level is unchecked.
-
July 4, 2018 at 7:34 pm #25507
Resolved! Posting the script here and hopefully it helps someone in the future. Item Location Configuration is a separate record type to item.
function updReorderPoint(rec_type, rec_id)
{
var itemRec = nlapiLoadRecord(rec_type, rec_id)
itemRec.setFieldValue(‘reorderpoint’, null);
itemRec.setFieldValue(‘preferredstocklevel’, null);
nlapiSubmitRecord(itemRec);
}
-
July 6, 2018 at 6:53 pm #26039
Awesome! Thanks for sharing.
-
AuthorPosts
You must be logged in to reply to this topic.