Wednesday, October 24, 2018

SQL Query to Mark Purchase Orders with Production Orders

Update PRODBOM set InventRefId = purchTable.PurchID , InventRefTransID  = PurchTable.InventTransID where PRODBOM.ProdID = 'xxxxx' and PRODBOM.INVENTTRANSID = 'xxxxx'

Update Purchline set InventRefId = prodBOM.ProdId , InventRefTransID = prodBOM.InventTransID where Purchline.PurchID  = 'xxxx' and PURCHLINE.INVENTTRANSID = 'xxxx'

Example:

-- Need to update InventRefId = 'PO-00396604' and InventRefTransID  = 'LOT-078665474' on ProdBOM with Purchline data (PurchId, InventTransID)
-- Need to update InventRefId = 'WO-00605046' and InventRefTransID = 'LOT-078665467' on Purchline with ProdBOM data (ProdId, InventTransID)"

No comments:

Post a Comment