This is really strange and I’m hoping someone can help. I’m using the CustShip BO through an external DLL that is called by an updatable dashboard to create shipments from imported UD records. This BO has been a pain because it seems it doesn’t act like other BO’s in that multiple tables are updated in one method call and following the traced methods doesn’t give you all you need to get it to work. Having said that, I got it to work, sort of…
The latest issue I’ve had is that when the lines are created and I want to mark the shipment as shipped, when the update method or updatemaster is called, the BO changes the packnum of the header records to the next available pack number creating orphaned records in the ShipDtl table. Has anyone ever seen this?
As a work around, I disposed the dataset and BO and reinitialized and called GetById before the update thinking I could get a fresh dataset in memory and then set it to shipped but then I get an error that I can’t troubleshoot. See below. Any help would be appreciated.
See screenshot of packnum being changed.
csTS = null;
csBO.Dispose();
csBO = null;
csTS = new Erp.Tablesets.CustShipTableset(); // TableSet
csBO = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.CustShipSvcContract>(Db);
csTS = csBO.GetByID(returnVal);
sHead = csTS.ShipHead.FirstOrDefault();
System.Collections.IList pCodes = new List<string>();
csBO.GetPkgCodeQtyList(returnVal, out pCodes);
sHead.ReadyToInvoice = true;
sHead.RowMod = "U";
csBO.Update(ref csTS);
Error:
" at Epicor.Data.BufferCopy.GetRowCopier(Object fromItem, Object toItem, Boolean fullRowCopy)\r\n at Epicor.Data.BufferCopy.Copy(Object fromItem, Object toItem, Boolean includeSysRowID)\r\n at Epicor.Data.BufferCopy.Copy[TTypeTo](Object fromItem, TTypeTo& toItem)\r\n at Erp.Services.BO.CustShipSvc.UpdateMaster(CustShipTableset& ds, Boolean doValidateCreditHold, Boolean doCheckShipDtl, Boolean doLotValidation, Boolean doCheckOrderComplete, Boolean doPostUpdate, Boolean doCheckCompliance, Boolean ipShippedFlagChanged, Int32 ipPackNum, Int32 ipBTCustNum, String& opReleaseMessage, String& opCompleteMessage, String& opShippingMessage, String& opLotMessage, String& opInventoryMessage, String& opLockQtyMessage, String& opAllocationMessage, String& opPartListNeedsAttr, String& opLotListNeedsAttr, String& shipCreditMsg, Boolean& cError, Boolean& compError, String& msg, String& opPostUpdMessage, Boolean& updateComplete, Boolean& checkComplianceError, Boolean& changeStatusError, Boolean& checkShipDtlAgain) in C:\_Releases\ERP\UD10.2.400.9\Source\Server\Services\BO\CustShip\CustShip.cs:line 34235\r\n at Erp.Services.BO.CustShipSvcFacade.UpdateMaster(CustShipTableset& ds, Boolean doValidateCreditHold, Boolean doCheckShipDtl, Boolean doLotValidation, Boolean doCheckOrderComplete, Boolean doPostUpdate, Boolean doCheckCompliance, Boolean ipShippedFlagChanged, Int32 ipPackNum, Int32 ipBTCustNum, String& opReleaseMessage, String& opCompleteMessage, String& opShippingMessage, String& opLotMessage, String& opInventoryMessage, String& opLockQtyMessage, String& opAllocationMessage, String& opPartListNeedsAttr, String& opLotListNeedsAttr, String& shipCreditMsg, Boolean& cError, Boolean& compError, String& msg, String& opPostUpdMessage, Boolean& updateComplete, Boolean& checkComplianceError, Boolean& changeStatusError, Boolean& checkShipDtlAgain) in C:\_Releases\ERP\UD10.2.400.9\Source\Server\Services\BO\CustShip\CustShipSvcFacade.cs:line 4692\r\n at ProcessExecutionLoads.CSExecution.CreateCustomerShipment(ErpContext Db, UD109Row udHead, IEnumerable`1& udDtls, String Plant) in E:\Epicor\Externals\Source\E10.2.400\ProcessExecutionLoads\CSExecution.cs:line 200"
