on 2022 Apr 06 1:38 PM
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();
User | Count |
---|---|
115 | |
9 | |
8 | |
6 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.