Ok it seems I found the issue. I needed to create a duplicate header record in the dataset of the current header data row and then change one of the records RowMod to U and ReadyToInvoice to true. This is usually done in the backend by the BO, but in this case it wasn’t. I just used BufferCopy and below is the code in case anyone has to deal with this mess.
Also, I noticed that UpdateMaster works differently based on the flags that are set to true, while this is normal behavior seemingly, if you don’t get the right combination of the flags set to true, it wont do the task you want. For example, I had to set all the flags to false in order to get the method to run without error. If I had the two flags (that are shown in the trace) set to true, it wouldn’t do anything. On some instances in other places I was using it, it would throw an error, usually a null reference to a ttRow, which didn’t make sense because those rows existed in the TS. So play with the combos.
Also, check the updatecomplete flag on the masterupdate. If that is false, but you got no error, most likely you got a warning. This would usually be a popup in the UI asking the user if they want to continue. To accept the warning, call the UpdateMaster again with all the flags set to false. It should save.
Also after adding all the lines, I had to reload the TS because of what I had to do to add the lines. It seems after the first line added before you call GetNewOrderShipDtl, you need to modify the first row’s RowMod to equal U (and only the first row no matter how many you add) and get the order info then before you update, remove the RowMod value to be a blank so it doesn’t update into the db.
I don’t normally post code, but this BO is messy and hopefully this helps someone down the road.
sHead = csTS.ShipHead.FirstOrDefault();
Erp.Tablesets.ShipHeadRow copyRow = new Erp.Tablesets.ShipHeadRow();
BufferCopy.Copy(sHead, copyRow);
csTS.ShipHead.Add(copyRow);
sHead.ReadyToInvoice = true;
sHead.RowMod = "U";
csBO.UpdateMaster(ref csTS, false, false, false, false, false, false, false, sHead.PackNum, sHead.BTCustNum, out opRelMes, out opCompMes, out opShipMes,
out opLotMes, out opInvMes, out opLockQtyMes, out opAllocMes, out opPLMes, out opLLMes, out opCredMes, out cErr, out compErr,
out oMes, out opPostMes, out updateComplete, out chkCompError, out chgStatError, out chkDtlAgain);