2017-02-09 86 views
1

我正在编写一个客户端脚本,其中使用了物品的内部ID和位置的库存位置ID以供下拉选择。我想要获得库存盘点记录中的物料的'数量选择'。我如何在使用项目内部ID的搜索过滤器中执行此操作?Netsuite - 如何过滤多个记录上的物品搜索

var filters = new Array(); 
     filters[0] = new nlobjSearchFilter('inventorylocation', null, 'anyof', location); 
     filters[1] = new nlobjSearchFilter('internalid', null, 'anyof', item); 
     //filters[2] = new nlobjSearchFilter('item', 'inventorycount', 'anyof', item); 
var columns = new Array(); 
     columns[0] = new nlobjSearchColumn('locationquantitycommitted'); 
     columns[1] = new nlobjSearchColumn('locationquantityonhand'); 
     columns[2] = new nlobjSearchColumn('locationquantitybackordered'); 
     //columns[3] = new nlobjSearchColumn('quantitypicked'); 

评论行是我想要实现的。

回答

0

从我可以看到,这不是项目记录上可用的字段。你可以通过搜索计算的话 -

var search = nlapiSearchRecord('itemfulfillment', null, 
    [ 
     ['status', 'anyof', 'ItemShip:A'], 'AND', // ItemShip:A = Item Fulfillment:Picked 
     ['item', 'anyof', item], 'AND', 
     ['location', 'anyof', location], 
    ], 
    [ 
     new nlobjSearchColumn('item', null, 'GROUP'), 
     new nlobjSearchColumn('quantity', null, 'SUM') 
    ] 
); 
+0

所以我找到了一个解决方案,我用使用列[3] =新nlobjSearchColumn(“quantitypicked”,“交易”)在columnSearch联接; – shutdowndev