pricerc wrote:Cool.
and now for the next tricky bit. Not sure why I didn't think to ask this question earlier as well:
Can I get a list of orders that were released by the process so that I can send them to printers and/or EDI?
Or can I build/process the list myself using the ProcessSnapshotCreated event?
The table SO_BORun is inserted into for each BO Process run. The table SO_BORunLines links to that and a row inserted for each backorder released on the run. The MAX(SO_BORun.RunNo) will be the most recent run.
If you're only interested in backorders released to sales orders, you can join in the sales order tables - e.g.:
- Code: Select all
SELECT SO_BORunLines.*, SO_Lines.PartNo, SO_History.HistoryNo, SO_Main.InvoiceNo
FROM SO_BORunLines
JOIN SO_BORun ON SO_BORun.RunID = SO_BORunLines.RunID
JOIN SO_Lines ON SO_Lines.InvoiceLineID = SO_BORunLines.SourceLineID
JOIN SO_History ON SO_History.InvoiceHistoryID = SO_Lines.InvoiceHistoryID
JOIN SO_Main ON SO_Main.InvoiceID = SO_History.InvoiceID
WHERE SO_BORun.RunNo = (SELECT MAX(SO_BORun.RunNo) FROM SO_BORun)