cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot add row without complete selection of batch/serial numbers on delivery

0 Kudos
517

The item has multiple UOMs, if I use the Sales/Purchasing UOM code I get the error: -4014:Cannot add row without complete selection of batch/serial numbers, if I use the UOM group code I don't receive the error.

Code:

oDelivery.DocNum = Glo.NextDocNum;

oDelivery.CardCode = _Client;

oDelivery.NumAtCard = U_Waybill;

oDelivery.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items;

oDelivery.DocDate = DateTime.Now;

oDelivery.DocDueDate = DateTime.Now;

oDelivery.TaxDate = DateTime.Now;

oDelivery.Lines.BaseLine = Convert.ToInt32(_BaseLineRef);

oDelivery.Lines.BaseType = (int)SAPbobsCOM.BoObjectTypes.oOrders;

oDelivery.Lines.ItemCode = U_ItemNo;

oDelivery.Lines.Quantity = Convert.ToDouble(U_DelQty);

oDelivery.Lines.AccountCode = Convert.ToString(_AccountCode);

oDelivery.Lines.PackageQuantity = Convert.ToDouble(U_DelQty);

oDelivery.Lines.UoMEntry = _UCOMCode;

oDelivery.Lines.UnitsOfMeasurment = _uomQty;

oDelivery.Lines.UseBaseUnits = BoYesNoEnum.tNO;

oDelivery.Lines.WarehouseCode = _WHS;

if (!String.IsNullOrEmpty(Convert.ToString(reader["U_BatchNumber"].ToString())))

{

oDelivery.Lines.BatchNumbers.SetCurrentLine(0);

oDelivery.Lines.BatchNumbers.Quantity = Convert.ToDouble(U_DelQty);

oDelivery.Lines.BatchNumbers.BatchNumber = Convert.ToString(U_BatchNumber);

oDelivery.Lines.BatchNumbers.Add();

}

oDelivery.Lines.Add();

oDelivery.Add();

Accepted Solutions (0)

Answers (0)