我的工作与批次编号库存,我必须获得“库存编号仓位”记录或最小的仓位编号。我有“库存编号”的记录。我在记录浏览器中查找"Inventory Numbered“,它显示为"join only”,但我不知道我连接的是什么,因为可用join字段仅为"user“。如果有人能给我指明正确的方向,我将不胜感激。
发布于 2019-08-19 14:20:42
由于我似乎在任何地方都找不到的原因,库存编号记录没有直接连接到库存编号Bin记录。但是,库存编号Bin记录充当库存编号和Bin记录之间的中介。
如果您查看Inventory Number Bin记录,您会发现"inventorynumber“和"binnumber”列。可以在没有直接联接的情况下在搜索中使用它们来获取记录。
require(['N/search', 'N/record'], function(search, record) {
// Load an inventory number record
var inventoryNumber = record.load({ type: 'inventorynumber', id: 1234 });
// Get the inventory number field
var inventoryNumberId = inventoryNumber.getValue('inventorynumber');
search.create({
type: 'inventorynumberbin',
filters: ['inventorynumber', 'is', inventoryNumberId],
columns: ['binnumber']
}).run()
.each(function(result) {
// Log the bin numbers related to the inventory number
log.debug(result.getValue('binnumber'));
return true;
});
});https://stackoverflow.com/questions/57510762
复制相似问题