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...
Suggested Answer

InvalidTableRelation error on Customer when creating SalesOrder via API

(0) ShareShare
ReportReport
Posted on by 10

When posting to /salesOrders with payload {"customerNumber": "1010117"}, I get an error:

Internal_InvalidTableRelation","message":"The field Sell-to Customer No. of table Sales Order Entity Buffer contains a value (1010117) that cannot be found in the related table (Customer)

But I can fetch the customer with:

/customers?$filter=number eq '1010117'

Similar error occurs when attempting to create the Order with customerId. However, a sales order can be manually created for the customer via the UI.

What could be the reasons for this error?

I have the same question (0)
  • JAngle Profile Picture
    159 on at

    are you 100% sure it is the same company ID being used? I have tested and do not get an error with the same payload

  • Robin Becker Profile Picture
    10 on at

    Yes I'm sure, I triple checked. Also the same thing works for me in a sandbox environment with a different customerId

  • Suggested answer
    Marco Mels Profile Picture
    Microsoft Employee on at

    Hello,

    If this is something you can reproduce in standard as well, feel free to raise it to Microsoft support via your partner or CSP. (or if the environment is customized but in this area not customized, we can also take a look of course).

    Thanks.

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 July Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 595 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 364 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 331 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans