Hi Jonathan,
you have to put doc.PO.Lines.Add() beforehand - otherwise you are just changing line 0.
... // Add a new PO line that makes up the difference in what was shipped and the original quantity docPO.Lines.Add(); docPO.Lines.ItemCode = ssi.itemCode; docPO.Lines.Quantity = System.Convert.ToDouble(poLineRow["OpenQty"].ToString()) - draft.Lines.Quantity; docPO.Lines.WarehouseCode = ssi.whsCode; docPO.Lines.Price = ssi.price; // Now modify the existing, "original" PO line item to reflect the quantity change (this will show what actually shipped) docPO.Lines.SetCurrentLine(System.Convert.ToInt32(poLineRow["LineNum"].ToString())); ...
regards,
Maik