Ok, I run through all the steps to create the Customer Shipment …
EpicorRest.DynamicPost("Erp.BO.CustShipSvc", "GetNewShipHead", postData);
EpicorRest.DynamicPost("Erp.BO.CustShipSvc", "GetHeadOrderInfo", postData);
EpicorRest.DynamicPost("Erp.BO.CustShipSvc", "GetLegalNumGenOpts", postData);
EpicorRest.DynamicPost("Erp.BO.CustShipSvc", "UpdateMaster", postData);
EpicorRest.DynamicPost("Erp.BO.CustShipSvc", "PreCreateMassShipDtl", postData);
EpicorRest.DynamicPost("Erp.BO.CustShipSvc", "CreateMassShipDtl", postData);
EpicorRest.DynamicPost("Erp.BO.CustShipSvc", "GetManifestInfo", postData);
EpicorRest.DynamicPost("Erp.BO.CustShipSvc", "MarkShipmentLines", postData);
… then I run the ShipHead fix (where there are TWO ShipHeads) before the UpdateMaster …
var unmodifiedShipHead = ds.ShipHead[0];
unmodifiedShipHead.RowMod = "";
ds.ShipHead.Add(unmodifiedShipHead);
EpicorRest.DynamicPost("Erp.BO.CustShipSvc", "UpdateMaster", postData);
… this yields a Customer Shipment w/ a good header and detail lines that we can see in the Epicor Client. At this point none of the lines are closed or marked ReadyToInvoice yet; this is where the trouble begins.
So, the next step according to the tracelog is to set the ShipHead[0].ReadyToInvoice = true and ShipHead[0].RowMod = “U” property values and then the last UpdateMaster.
(BTW, we’re running the UpdateMaster calls with all the same boolean values found in the tracelog). In this last case, they are all True except for the doLotValidation param.
When I make this call this morning on this new test, I get a new message that I haven’t seen in previous tests:
"Message": "Packing Slip is not open. Cannot update.",
"Type": "Error",
"Table": "ShipDtl",
"Program": "Erp.Services.BO.CustShip.dll",
"Method": "ShipDtlBeforeUpdate"
In an effort to self debug, I re-ran the above test on a brand new order (exact copy) but this time, at the end before the last UpdateMaster I called GetById to load a clean object. Then I set the SH.ReadyToInvoice = true, SH.RowMod = U properties, and then called the final UpdateMaster and got a reply back:
Value cannot be null.
Parameter name: fromItem"
… and when I try to find the PackNum that was generated I see that it’s been deleted! AND it created a new incremented PackNum. Neither of which are linked to the Sales Order.
So while Customer Shipments are being created, we can’t find a way to link them successfully to the SalesOrder nor mark them ReadyToInvoice.
So that’s a lot of detail. I hope it helps shed some light?