javascript - Netsuite - 如何过滤多个记录的项目搜索

标签 javascript filter netsuite suitescript

我正在编写一个客户端脚本,其中使用项目的内部 id 和位置的库存位置 id 进行下拉选择。我想获取库存计数记录中的商品的“数量”。如何使用项目的内部 ID 在搜索过滤器中执行此操作?

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');

注释行是我想要实现的目标。

最佳答案

据我所知,这不是项目记录上可用的字段。您可以通过搜索来计算 -

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')
    ]
);

关于javascript - Netsuite - 如何过滤多个记录的项目搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42132812/

相关文章:

javascript - 问题搜索 NetSuite - nlapiSearchRecord

javascript - NetSuite RESTlet,提交日期/时间时区问题

javascript - Facebook SDK FB.GetLoginStatus 加载被 X-Frame-Options 拒绝(仅限 Firefox)

javascript - React spring过渡,实现每个元素的进入渐进式延迟

javascript - 从数组中过滤 NaN

node.js - 使用 Mongoose 使用 arrayFilters 查找

javascript - 从数组中查找和删除项目的合适的数据结构或算法是什么

netsuite - 将变量从用户事件脚本传递到NetSuite中的客户端脚本

javascript - CSS HTML : Is there workaround for parent scaling and child position:fixed?

Javascript/jQuery 自动设置和更新时间