Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Posting in the Item Tracking line table using web services

(0) ShareShare
ReportReport
Posted on by

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans