How to: Fix issues related to Intercompany chain and clean up broken inventory transcations
For those who have worked in Intercompany SO-POs know it very well that sometimes users across different legal entities face challenges in IC SO and IC PO. Issues with qty, statuses of lines or statuses of headers, broken inventory transactions for which nothing can be done. Below is the script to fix the status on lines, the status on the header, and delete broken inventory transactions: static void Job1(Args _args) { PurchLine purchLine,purchLineGB; InventTrans inventTrans,inventTransGB; InventTransOrigin inventTransOrigin,inventTransOriginGB; SalesLine salesLine,salesLineGB; SalesTable salestable,salestableGB; PurchTable purchTable,purchTableGB; void updateSO(inventTransId _inventTransId, SalesStatus _lineSalesStatus, SalesStatus _orderSalesStatus) { select forupdate salesLine where salesLine.I...