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 :
Business Central forum

Custom Sale Invoice Integration

(0) ShareShare
ReportReport
Posted on by 55

Hi All,

I am developing custom Sales invoice integration in AL and when I am inserting Document Date from staging table to "Sales Header" table it is updating with today's date but not that date which user is putting through the custom screen or web service, but when I am creating sales invoice from standard Dynamics 365 Business Central screen I can put different Document Date, any thoughts What I am missing. Below is the code snippet.

SalesHeader.Validate("Document Date", StagingHeader."Document Date");

SalesHeader.Insert(true);

Categories:
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    You should first use SalesHeader.Insert(true), then assign the custom date with a Modify().

  • Verified answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,306 Super User 2026 Season 1 on at

    The Insert(true) validation overwrite the document date to workdate.

    You will need to do insert first before putting document date.

    SalesHeader.Insert(true);

    SalesHeader.Validate("Document Date", StagingHeader."Document Date");

    SalesHeader.modify(true);

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans