Hi,
I am creating Sales Invocies through a .net application using web services. However no matter what I set the document date to, it is overriden with the posting date.
NAV.SalesInvoice si = new NAV.SalesInvoice(); si.Sell_to_Customer_Name = r.Cells["Client"].Value.ToString(); si.Posting_Date = postingDate.Value; si.Document_Date = invoiceDate.Value; nav.AddToSalesInvoice(si); nav.SaveChanges();
Despite having a different posting and invoice date the invoice in NAV has changed the document date to the document posting date.
Subsequent calls to correct it in the routine also don't fix it:
si.Document_Date = invoiceDate.Value; nav.SaveChanges();
Does anyone know how to correct this?
Thanks
I am using Page with Object ID 43 - Sales Invoice.
Justin,
As I mentioned earlier if you update the document date after the posting date it should work, I know it is as standard behavior that document date gets updated when you validate posting date but if you assign that later it should work unless there is a customization blocking or reversing the change. Which page are you using for the web services ?
Hi Suresh,
It is standard NAV behaviour i.e. changing the posting date changes the document date to the same date. However I can still change the document date after the posting date has been set. That is why I try setting the document date 2nd in the code and then try again after the first SaveChanges call. Any ideas?
Thanks
Justin
What happens when you create an invoice directly in NAV, does it allow changes to the document date? in standard NAV it should allow you to change the value if you assign that value after the posting date, I believe there may be some changes in the system which is defaulting to the posting date, please check if there are any customizations.
Hello,
We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist. If you need assistance with debugging or coding I would recommend discussing this on one of our communities.
dynamicsuser.net/.../developers
I will open this up to the community in case they have something to add.
Thanks.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156