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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Custom API Page - Order Date

(0) ShareShare
ReportReport
Posted on by 14

I've run into an issue with my custom Sales Header API page.

When I create a Sales Order by sending a POST request through Postman, everything is inserted correctly except for the Order Date. Regardless of the value I send in the request body, the Order Date is always changed to the current Work Date.

After several hours of trying, I managed to narrow the issue down to the standard Sales Header table. the Init() procedure sets the Order Date to the current Work Date from my understanding.

I continued debugging and found that this appears to be related to the API page's DelayedInsert = true property. With DelayedInsert = true, the Order Date is always initialized to the Work Date before my value is applied. I don't fully understand the logic behind this, but removing DelayedInsert isn't possible on a custom API page.

As a test, I changed the page from PageType = API to PageType = Document, removed DelayedInsert, published the document page as a web service, and the issue was solved, the Order Date from my request was inserted correctly. this confirms the issue, but using a document page exposed as an OData web service isn't the solution I want.

Has anyone encountered this before? Is there a recommended way to work around this while still using a custom API page? Or is my only real option to move away from API pages and implement something like a SOAP/codeunit or another custom endpoint where I have full control over the insertion process?

I'd prefer to keep this as an API page if there's anything I'm overlooking.

I have the same question (0)

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 686 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 447 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 328 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans