我试图从Netsuite中的记录中的子列表中获取值,但我似乎无法获得值,我只能得到null。这就是我正在做的事情:
首先我用nlapiLoadRecord
获取记录fulfillment = nlapiLoadRecord('itemFulfillment', '102568');
我得到子列表的itemCount:
var itemCount = fulfillment.getLineItemCount('item');
我创建一个循环来获取值,但是这里返回所有空值:
for(var y = 1; y <= itemCount; y++){
info += fulfillment.getLineItemValue('items', 'custcol_old_material_num', i) + " ";
}
我得到的fullfillment对象是下一个:
fulfillment:{
"finalshipto": "text",
"shipstatus": {
"internalid": "C",
"name": "Shipped"
},
......
......
......
"item": [ <--this is what I want to access
{
"custcol_calculated_weight": 835.2,
"custcol_item_weight ": 17.4,
"custcol_old_material_num": "56624210655084",
"description": "1x1x-xxxx TEXT", <---this is the data I want to print
"excludefromraterequest": false,
"inventorydetail": {
"itemdescription": "1x1x-xxxx TEXT",
"item": {
"internalid": "xxxx",
"name": "xxxxxxx"
},
"unit": {
"internalid": "1",
"name": "TEXT"
},
"quantity": xx,
"inventoryassignment": [
{
"binnumber": {
"internalid": "xxxx",
"name": "TEXT"
},
"quantity": 48,
"quantityavailable": 48
}
]