Hi
I'm trying to add serials to an existing documnet. It doesn't gives any error message, but doesn't works! Could anybody help me? Thanks!
I'm trying whit this:
SAPbobsCOM dn = Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes) as SAPbobsCOM.Documents;
if(dn.GetByKey(21)) { //an existing document
SAPbobsCOM.Document_Lines lines = dn.Lines;
lines.SetCurrentLine(0);
SAPbobsCOM.SerialNumbers sn = lines.SerialNumbers;
sn.Add(); //or sn.SetCurrentLine(0);
sn.SystemSerialNumber = 1;
sn.ManufacturerSerialNumber = "55555";
sn.InternalSerialNumber = "555551";
sn.BatchID = "blabla";
int ec = dn.Update();
if(ec != 0) { ...} //handling err.message
//dn.SaveXML(... when I save the document to xml, it contains the serial, but it is not booked
}
Thanks
Zoli
Hi Zoli,
I haven't tried to add serial numbers to an existing delivery yet, but have been trying to add serial numbers to a return (in order to reverse a delivery note). My problem is that although I try to use the existing SystemSerialNumber and ManufacturerSerialNumber, always a new item is created with a new SystemSerialNumber rather than using the existing item.
It works OK if I create a delivery note and can choose from existing serial numbers, the problem seems to be that the because the items are "unavailable", they cannot be selected.
Regards,
Corbin
Add a comment