【问题标题】:Netsuite - How do I filter Item search on multiple recordsNetsuite - 如何过滤多条记录的项目搜索
【发布时间】:2017-02-09 09:29:01
【问题描述】:

我正在编写一个客户端脚本,它使用项目的内部 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');

注释行是我想要实现的。

【问题讨论】:

    标签: javascript filter netsuite suitescript


    【解决方案1】:

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

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

    【讨论】:

    • 所以我找到了解决方案,我在 columnSearch 中使用了 columns[3] = new nlobjSearchColumn('quantitypicked', 'transactions');
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-30
    • 1970-01-01
    • 2016-02-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多