问题
如何通过SuiteQL拿到库位、批次等信息?
解决
通过类似以下的请求方式
FROM transaction
INNER JOIN transactionline on transactionline.transaction = transaction.id
INNER JOIN inventoryassignment on inventoryassignment.transactionline = transactionline.id
and inventoryassignment.transaction = transactionline.transaction
从查询角度来说,inventoryAssignment表是复合主键
常用的值可能有quantity, inventorynumber, bin, inventorystatus
举例,如下请求
SELECT
BUILTIN.DF(TransactionLine.item) as Item,
BUILTIN.DF(Inventoryassignment.inventorynumber) as lot,
BUILTIN.DF(Inventoryassignment.bin) as Bin,
Inventoryassignment.quantity
FROM Transaction
INNER JOIN TransactionLine on TransactionLine.transaction = Transaction.id
INNER JOIN Inventoryassignment on Inventoryassignment.transactionline = TransactionLine.id
AND Inventoryassignment.transaction = TransactionLine.transaction
WHERE Transaction.recordtype = 'itemreceipt'
AND Transaction.id = 1234567
取回结果类似如下表格
Item | Lot | Bin | Quantity |
Item 1 | Lot 0001 | Bin A | 10 |
Item 2 | Lot 0002 | Bin B | 12 |
Comments