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

Business central API Sales Order Line POST

(0) ShareShare
ReportReport
Posted on by

Hello all!

We are using Business Central API for Sales Order lines posting. docs.microsoft.com/.../dynamics_create_salesorderline
When we trying to post line for item which doesn't have enough stock we receive following error:

Exception: Something went wrong, see content for more details: {"error":{"code":"Internal_RecordNotFound","message":"The Sales Line does not exist. Identification fields and values: Document Type='Order',Document No.='1601',Line No.='10000' CorrelationId: 3ef083b4-c7f2-40f6-a109-c86690aecf57."}}

When we try to create exactly same order (with same quantities in line) in Business central it successfully created and just give us a warning about stock.
Can someone suggest us please, how we can avoid this error in API? Or maybe we need to add something into information we posting?

Thanks in advance!

I have the same question (0)
  • Suggested answer
    Jack Davies Profile Picture
    120 on at

    This sounds like more a timing issue...(as in the API is creating the sales line and validating the fields without inserting the record (and then a piece of code is looking for that line)). Whereas when you do the same with your fingers in the client one of the controls/ validations of the sales order subpage is inserting the record before the qty is validated.

    If you can edit the API page - convert it to source table temporary, and the via the OnInsert/OnModify/... triggers code the creation of the sales lines to insert and then validate your remaining fields...

    or

    Change you API calls to be a POST simply creating the sales line, and then a second call to  PATCH the created sales line with the remaining fields

  • Community Member Profile Picture
    on at

    Thanks for your reply Jack!

    We use normal MBC API, not our custom AL API Page

    Can you tell me please,  based on your answer i understand that this is more issue about validation time. But when we do insert in MBC itself (by hands) we don't have any errors at all and line succesfullt created even after validation.

    So maybe API has some additional validation steps which not allow us to insert lines without stock? Or we can enable\disable some settings in MBC to use it smae way as it in MBC itself?

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 2,028 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,121 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 669 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans