Skip to Content
0
Former Member
Sep 10, 2014 at 04:09 AM

Cannot add Serial/Batch Numbers when i update the Pick List quanity

36 Views

This is the code when i update the pick list with the quantity.

In this case when i update the exact serial number for the particular pick number this code works.Suppose the client need to change the another serial number this code doesn't work.

Please what are the things that i need to change to update the serial numbers for the pick list.

XmlNodeList elemList = xmlDocument.SelectNodes("PickList/LineNum");

oPickList.GetByKey(PickListNo);

int x = 0;

foreach (XmlNode ele in elemList)

{

XmlAttribute lID = ele.Attributes["LineNum"];

if (lID != null)

{

lineNumber = lID.Value;

}

oPickList.Lines.SetCurrentLine(Convert.ToInt32(lineNumber));

oPickList.Lines.PickedQuantity += Convert.ToDouble(ele.SelectSingleNode("QTP").InnerText);

oPickList.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = x;

oPickList.Lines.BinAllocations.BinAbsEntry = Convert.ToInt32(ele.SelectSingleNode("BinLocation").InnerText.ToString());

oPickList.Lines.BinAllocations.Quantity = Convert.ToDouble(ele.SelectSingleNode("QTP").InnerText);

oPickList.Lines.BinAllocations.Add();

oPickList.Lines.SerialNumbers.SetCurrentLine(x);

oPickList.Lines.SerialNumbers.InternalSerialNumber = ele.SelectSingleNode("ScanSerialNumber").InnerText.ToString();

oPickList.Lines.SerialNumbers.Quantity = Convert.ToDouble(ele.SelectSingleNode("QTP").InnerText);

oPickList.Lines.SerialNumbers.Add();

x++;

}

oPickList.Update();

((SAPbobsCOM.Company)HttpContext.Current.Cache[sid]).GetLastError(out iErrorCode, out sErrMsg);

System.Runtime.InteropServices.Marshal.ReleaseComObject(oPickList);

oPickList = null;