Problem with CUSTSHIP the pickedOrders they do not disappear

When I create a shipHead and shipDtl the ship is created correctly, but when I look at pickedorders, the lines of the order is available to to create a new SHIP.

HELP! Thanks.

this is the code

private int createpack(int orderNum,string company)
{
	try{
		double totalOlaPick=0,totalOlaValidado=0;
		int valorCero=0,custNum=0;
		System.Collections.IList list;
		bool valorBol=false;
		string message=String.Empty;

		// Declare and create an instance of the Adapter.
		CustShipAdapter adapterCustShip = new CustShipAdapter(this.oTrans);
		adapterCustShip.BOConnect();
		
		adapterCustShip.GetNewShipHead();

		DataRow ship = adapterCustShip.CustShipData.ShipHead[adapterCustShip.CustShipData.ShipHead.Rows.Count - 1];
		ship["Company"] = company;
		ship["OTSOrderNum"] = orderNum;
		ship["CurrencyCode"] = "MXP";		
		ship["ShipViaCode"] = 1;
		adapterCustShip.Update();
		
		adapterCustShip.CheckPCBinOutLocation(out valorCero,out valorBol,out message);
		adapterCustShip.UpdateMaster(true,true,valorBol,true,true,valorBol,true,valorCero,custNum,out message,out message,out message,out message,
						out message,out message,out message,out message,out message,out message,out valorBol,out valorBol,out message,out message,
						out valorBol,out valorBol,out valorBol,out valorBol);

		adapterCustShip.Dispose();
		oTrans.Update();


		return Convert.ToInt32(ship["PackNum"].ToString());;
	}
	catch (Exception ex)
    {
			ExceptionBox.Show(ex);
			SendKeys.Send("+{Tab}");   
			this.epiLabelLoading.Visible=false;
			this.epiButtonEmbarcar.ReadOnly=false;  
			return 0;     
    }
}

private void newline(string orderNum, string orderLine, string partNum, string desc,int qty,int pack,int custNum,string UM,string company)
{
	try
	{
		double totalOlaPick=0,totalOlaValidado=0;
		int valorCero=0;
		System.Collections.IList list;
		bool valorBol=false;
		string message=String.Empty;

		// Declare and create an instance of the Adapter.
		CustShipAdapter adapterCustShip = new CustShipAdapter(this.oTrans);
		adapterCustShip.BOConnect();
					
		adapterCustShip.GetByID(pack);
		adapterCustShip.POGetNew(valorCero,pack,out message);
		adapterCustShip.POGetDtlList(pack,message,valorCero,"PACK",out message);
		adapterCustShip.GetNewShipDtl(pack);
		adapterCustShip.GetNewOrdrShipDtl(pack,Convert.ToInt32(orderNum));

		adapterCustShip.BuildShipToCustomerList(Convert.ToInt32(orderNum),out message);
		adapterCustShip.BuildShipToList(Convert.ToInt32(orderNum),custNum,out message);

			DataRow ship = adapterCustShip.CustShipData.ShipDtl[adapterCustShip.CustShipData.ShipDtl.Rows.Count - 1];
			ship["Company"] = company;
			ship["CustNum"] = custNum;
			ship["OrderNum"] = orderNum;
			ship["OrderLine"] = orderLine;
			ship["OrderRelNum"] = 1;
			ship["PartNum"] = partNum;
			ship["LineDesc"] = desc;
			ship["WarehouseCode"] = "2";
			ship["BinNum"] = "DG";
			ship["InventoryShipUOM"] = UM;
			ship["SalesUM"] = UM;
			ship["IUM"] = UM;
			ship["ShipCmpl"] = 0;
			ship["Packages"] = 1;
			ship["OurInventoryShipQty"] = qty;
			ship["SellingInventoryShipQty"] = qty;
			ship["PickedAutoAllocatedQty"] = qty;
			adapterCustShip.Update();

			
		// Cleanup Adapter Reference
		adapterCustShip.Dispose();
		oTrans.Update();


	} catch (System.Exception ex)
	{
		ExceptionBox.Show(ex);
			SendKeys.Send("+{Tab}");   
			this.epiLabelLoading.Visible=false;
			this.epiButtonEmbarcar.ReadOnly=false;  
	}
}

This happens occasionally to us. Epicor provided us with a data fix. FX_Upd_PickedOrders

1 Like