Hi,
I'm writing a Console application to import invoices into Navision. I'm able to import everything except a lot number that is associated to each line of the invoice.
I tried to use the Page 6510 "Item Tracking Lines" but I cannot find a way to post the new lines, only to read the existing one.
Is this the correct approach?
If so, what method can I call to write the lines?
If not, what is the correct method?
Thanks in advance,
Ignacio
PD: This is the code I'm using now to post invoices into navision:
SalesInvoice refer to page 43 "Sales Invoice"
var salesInvoice = new SalesInvoice.SalesInvoice(); salesInvoice.External_Document_No = order.PrintedOrderID; salesInvoice.No = order.PrintedOrderID; salesInvoice.Sell_to_Customer_No = order.Client.OriginalId; this.salesInvoiceService.Create(ref salesInvoice); salesInvoice.SalesLines = new Sales_Invoice_Line[order.OrderDetails.Count]; for (int j = 0; j < order.OrderDetails.Count; j++) { salesInvoice.SalesLines[j] = new Sales_Invoice_Line(); } salesInvoiceService.Update(ref salesInvoice); int i = 0; foreach (var detail in order.OrderDetails) { salesInvoice.SalesLines[i].No = detail.Product.OriginalId; salesInvoice.SalesLines[i].Type = SalesInvoice.Type.Item; salesInvoice.SalesLines[i].Quantity = System.Convert.ToDecimal(detail.Qty); salesInvoice.SalesLines[i].Unit_Price = System.Convert.ToDecimal(detail.Price); } salesInvoiceService.Update(ref salesInvoice);
*This post is locked for comments