on 09-10-2014 5:09 AM
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;
Hi Karthik,
The loop has at least a miss when IID == null.
Besides this, easiest would be to empty fully the BatchNumbers list and to reconstruct it entirely...
Regards,
Eric
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
7 | |
7 | |
4 | |
3 | |
3 | |
3 | |
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.