web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

NAV 2017 Web Service Sales Invoice Document Date

(0) ShareShare
ReportReport
Posted on by

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 have the same question (0)
  • Suggested answer
    Marco Mels Profile Picture
    Microsoft Employee on at

    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.

    www.yammer.com/dynamicsnavdev

    dynamicsuser.net/.../developers

    I will open this up to the community in case they have something to add.

    Thanks.

  • Suggested answer
    Suresh Kulla Profile Picture
    50,278 Super User 2026 Season 1 on at

    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.

  • Justin756 Profile Picture
    on at

    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

  • Suggested answer
    Suresh Kulla Profile Picture
    50,278 Super User 2026 Season 1 on at

    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 ?

  • Justin756 Profile Picture
    on at

    I am using Page with Object ID 43 - Sales Invoice.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,796 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 965 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 664 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans