dclarke
03/20/2019, 9:24 AMvar id = nlapiGetRecordId();
var rec = nlapiLoadRecord('salesorder', id);
var l = rec.getLineItemCount('item');
var soItems = [];
for (var i = 0; i < l; i++)
{
soItems[i] = {};
soItems[i].item = rec.getLineItemValue('item', 'item', (i + 1));
soItems[i].qty = rec.getLineItemValue('item', 'quantity', (i + 1));
soItems[i].lineId = rec.getLineItemValue('item', 'id', (i + 1));
soItems[i].type = rec.getLineItemValue('item', 'itemtype', (i + 1));
var rec2 = nlapiLoadRecord('inventoryitem', soItems[i].item);
soItems[i].class = rec2.getFieldValue('custitem_product_type');
}
The item type I am getting for an item is InvPart, which then when I try to get the class of the item by loading the record, it complains it’s not InvPart, any ideas how I could load it?