Hi all,
This is a very weird one, maybe you guys can help. I have a simple function that creates a customer shipment with just one line. Just creates it, doesn’t ship it. When I call the function from Schedule Epicor Function, it works perfectly. But when I call the same function from Postman or Swagger, it does not update the inventory tables (PartWhse, PartQty, etc.). Everything else works just fine. I look at the Picked Qty and Sales Picked Qty in Part Tracker for example, and it does not update them. More than that, if I go to Customer Shipment Entry and ship the pack by checking the Shipped checkbox, it does not update the on-hand qty from PartBin and PartWhse!
Below is the code. I have tried almost everything I could find in this forum but no luck. There are 4 save methods there (update or updatemaster), all of them work perfectly from Schedule Epicor Function, but from Postman or Swagger none of them update the inventory tables! Am I missing something or is it something wrong with Update/MasterUpdate when called from REST ?
// CALL CustShip SERVICE
this.CallService<Erp.Contracts.CustShipSvcContract>(csc => {
// define custship tableset
Erp.Tablesets.CustShipTableset tsCustShip = new Erp.Tablesets.CustShipTableset();
// CREATE PACK
try
{
csc.GetNewShipHead(ref tsCustShip);
// set ShipVia and ThirdParty fields
tsCustShip.ShipHead[0].ShipViaCode = "TNL";
tsCustShip.ShipHead[0]["ThirdParty_c"] = "TigersNL";
// order info
csc.GetHeadOrderInfo(vSONo, out tstr, ref tsCustShip);
btcustomerno = tsCustShip.ShipHead[0].BTCustNum;
// legal nos
csc.GetLegalNumGenOpts(0, ref tsCustShip, out obool);
// pcbin
csc.CheckPCBinOutLocation(ref tsCustShip, out oint, out obool, out ostr);
// save
csc.UpdateMaster(ref tsCustShip,false,false,false,false,false,false,false,0, btcustomerno, out opReleaseMessage, out opCompleteMessage, out opShippingMessage, out opLotMessage, out opInventoryMessage, out opLockQtyMessage, out opAllocationMessage, out opPartListNeedsAttr, out opLotListNeedsAttr, out shipCreditMsg, out cError, out compError, out msg, out opPostUpdMessage, out updateComplete, out checkComplianceError, out changeStatusError, out checkShipDtlAgain);
}
catch (Exception ex)
{
throw new Ice.BLException("[newpack]" + ex.Message);
}
// get newly created pack number
vPackNo = tsCustShip.ShipHead[0].PackNum;
// create new pack line
csc.GetNewOrdrShipDtl(ref tsCustShip, vPackNo, 0);
// get order info
tsCustShip.ShipDtl[0].OrderNum = vSONo;
csc.GetOrderInfo(vSONo, out ostr, ref tsCustShip);
// get order line info
tsCustShip.ShipDtl[0].OrderLine = vSOLine;
csc.GetOrderLineInfo(ref tsCustShip, 0, vSOLine, String.Empty);
// get order rel info
tsCustShip.ShipDtl[0].OrderRelNum = vSORel;
csc.GetOrderRelInfo(ref tsCustShip, 0, vSORel, false);
// get part info
tstr = vPartNo;
tsCustShip.ShipDtl[0].PartNum = tstr;
csc.GetPartInfo(ref tsCustShip, 0, ref tstr, Guid.Empty, String.Empty, out ostr, out ostr, out obool, out ostr);
// set warehouse, bin and qty
tsCustShip.ShipDtl[0].WarehouseCode = vWarehouse;
csc.GetWhseInfo(ref tsCustShip, 0, vWarehouse, "WarehouseCode");
// set bin
tsCustShip.ShipDtl[0].BinNum = vBin;
csc.ValidateBinCode(vWarehouse, vBin);
// set qty
csc.GetQtyInfo(ref tsCustShip, 0, vQty, 0);
// save line
try
{
// pcbin
csc.CheckPCBinOutLocation(ref tsCustShip, out oint, out obool, out ostr);
// SAVE 1
//csc.Update(ref tsCustShip);
// SAVE 2
tsCustShip.ShipHead[0].RowMod = "U";
csc.UpdateMaster(ref tsCustShip,false,true,false,false,false,false,false,vPackNo, btcustomerno, out opReleaseMessage, out opCompleteMessage, out opShippingMessage, out opLotMessage, out opInventoryMessage, out opLockQtyMessage, out opAllocationMessage, out opPartListNeedsAttr, out opLotListNeedsAttr, out shipCreditMsg, out cError, out compError, out msg, out opPostUpdMessage, out updateComplete, out checkComplianceError, out changeStatusError, out checkShipDtlAgain);
// SAVE 3 (new row with 'U')
/*
oldRow = tsCustShip.ShipHead[0];
var newRow = tsCustShip.ShipHead.NewRow();
BufferCopy.CopyExceptFor(oldRow, newRow, "");
newRow.RowMod = "U";
tsCustShip.ShipHead.Add(newRow);
csc.UpdateMaster(ref tsCustShip,false,true,false,false,false,false,false,vPackNo, btcustomerno, out opReleaseMessage, out opCompleteMessage, out opShippingMessage, out opLotMessage, out opInventoryMessage, out opLockQtyMessage, out opAllocationMessage, out opPartListNeedsAttr, out opLotListNeedsAttr, out shipCreditMsg, out cError, out compError, out msg, out opPostUpdMessage, out updateComplete, out checkComplianceError, out changeStatusError, out checkShipDtlAgain);
*/
// SAVE 4 (new row with '')
/*
oldRow = tsCustShip.ShipHead[0];
var newRow = tsCustShip.ShipHead.NewRow();
BufferCopy.CopyExceptFor(oldRow, newRow, "");
oldRow.RowMod = "U";
tsCustShip.ShipHead.Add(newRow);
csc.UpdateMaster(ref tsCustShip,false,true,false,false,false,false,false,vPackNo, btcustomerno, out opReleaseMessage, out opCompleteMessage, out opShippingMessage, out opLotMessage, out opInventoryMessage, out opLockQtyMessage, out opAllocationMessage, out opPartListNeedsAttr, out opLotListNeedsAttr, out shipCreditMsg, out cError, out compError, out msg, out opPostUpdMessage, out updateComplete, out checkComplianceError, out changeStatusError, out checkShipDtlAgain);
*/
}
catch (Exception ex)
{
throw new Ice.BLException("[saveln " + vPartNo + "]" + ex.Message);
}
// END CALL CustShip SERVICE
});
Thanks!