Hi, hoping someone can point me in the right direction. Creating a sales order using a BPM and custom code. BPM successfully creates Header and detail row however header row OrderAmt/DocOrderAmt etc are not reflecting OrderDtl row DocExtPriceDtl values, header values remain 0.
You will need to buffer copy - then set the ready to calculate field in order for the totals to be updated in the OrderHead.
// UPDATE THE ORDERS AS READY TO CALCULATE - Absolute magic with the buffer copy to realise that the ReadyToCalc need updating to true
orderHedRow = ds.OrderHed.FirstOrDefault();
var updatedRow = (Erp.Tablesets.OrderHedRow)ds.OrderHed.NewRow();
BufferCopy.Copy(orderHedRow, updatedRow);
ds.OrderHed.Add(updatedRow);
updatedRow.ReadyToCalc = true;
updatedRow.RowMod = "U";
// Call Update
svc.MasterUpdate(true, true, "OrderHed", orderHedRow.CustNum, orderHedRow.OrderNum, false, out lContinue, out cResponseMsg, out cCreditShipAction, out cDisplayMsg, out cCompliantMsg, out cResponseMsgOrdRel, out cAgingMessage, ref ds);
soSvc.MasterUpdate(true, true, “OrderHed”, orderHedRow.CustNum, orderHedRow.OrderNum, true, out lContinue, out cResponseMsg, out cCreditShipAction, out cDisplayMsg, out cCompliantMsg, out cResponseMsgOrdRel, out cAgingMessage, out outstring,out outstring,out outstring ,ref ts);