添加示例:
var itemIds = [...]; // for some set of items
var itemPrices = nlapiSearchRecord('item', null,
[
new nlobjSearchFilter('internalid', null, 'anyof', itemIds),
new nlobjSearchFilter('currency', 'pricing', 'is', '1'), // use this line if you have multiple currencies. normally 1 is USD but this varies by account.
new nlobjSearchFilter('pricelevel', 'pricing', 'is', '5'), // default online price level id. You can use any id.
// new nlobjSearchFilter('customer', 'pricing', 'is', customerId) // if you are getting the prices for a particular customer
],[
new nlobjSearchColumn('unitprice', 'pricing'),
new nlobjSearchColumn('quantityrange', 'pricing')
]);
Note:
您可能想要限制商品列表,因为即使此示例也会返回行计数,即商品数 * 价格中断数。如果没有货币和价格水平过滤器,您可能会很快用完默认搜索结果限制(商品数量 * 价格水平数量 * 货币数量 * 价格中断数量),最终不得不使用较慢的策略来返回信息。