Skip to Content
0
Jul 29, 2016 at 02:19 PM

Adding AR INVOICE WITH SERIAL NUMBER BASED ITEM

963 Views

Dear ALL,

We are trying to add AR Invoice with serial number managed Items using SDK. We are currently running SAP Business One 9.2 patch 3 and our DI API & SDK with this version. we are getting error use existing serial/ batch number.

I had tried both setting under B one Client with Unique serial number as well None.

Our code is

oInvoice = (SAPbobsCOM.Documents)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);

oInvoice.CardCode = "C101100003";

oInvoice.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items;

oInvoice.DocDate = DateTime.Now;

int i = 0;

foreach (var item in Trn_Tickets)

{

Amount = Amount + (double)item.Payment;

oInvoice.Lines.ItemCode = item.ItemCode;

oInvoice.Lines.Quantity = 1;

oInvoice.Lines.Price = (double)item.Payment;

oInvoice.Lines.BaseLine = 1;

oInvoice.Lines.SerialNumbers.SystemSerialNumber = 9;

oInvoice.Lines.SerialNumbers.ManufacturerSerialNumber = "T1010001";

oInvoice.Lines.SerialNumbers.InternalSerialNumber = "9";

oInvoice.Lines.SerialNumbers.SetCurrentLine(i);

oInvoice.Lines.SerialNumbers.Add();

oInvoice.Lines.Add();

i = i + 1;

}

lRetCode = oInvoice.Add();

if (lRetCode != 0)

{

int temp_int = 0;

string temp_string = "";

oCompany.GetLastError(out temp_int, out temp_string);

}

Regards:

Prasanna