如何从 table 行的库存明细列中获取批号(在 Netsuite 中)?

How to get the lot number from inventory details column in line table(in Netsuite)?

我需要在库存明细行字段中打印批号的值,它实际上是一个小图标,当我点击它时,它会打开一个包含行项目的小 window。我只需要在我的 Suitelet 打印输出上打印它们。

我试图 运行 这个循环,但它打印了第一行的值(批号),但对于其他行,它显示 NULL。

var countitem=invAdjRec.getLineItemCount('inventory');
for (var c1=1;c1<=countitem;c1++)
{
invAdjRec.selectLineItem('inventory',c1);
var invDet = invAdjRec.getCurrentLineItemValue('inventory','inventorydetailavail');
var text="";
if (invDet == 'T')
{
var rec= invAdjRec.viewLineItemSubrecord('inventory', 'inventorydetail',c1);
var invcount = rec.getLineItemCount('inventoryassignment');
nlapiLogExecution('debug','invcount',invcount)
for(var xx = 1; xx <=invcount ; xx++) 
{
rec.selectLineItem('inventoryassignment', xx);
var idLot= rec.getLineItemText('inventoryassignment', 'issueinventorynumber',xx);
nlapiLogExecution('debug','idLot',idLot+':'+ xx)
text = text + 'Lot Number: ' + idLot + '\n';
}
}
}

试试这个:

var idLot = rec.getCurrentLineItemValue('inventoryassignment', 'receiptinventorynumber');

刚刚在我的一个帐户上尝试过,效果很好。