Skip to main content

Notifications

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?

  • Suggested answer
    Marco Mels Profile Picture
    Marco Mels on at
    RE: InvalidTableRelation error on Customer when creating SalesOrder via API

    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.

  • Robin Becker Profile Picture
    Robin Becker 10 on at
    RE: InvalidTableRelation error on Customer when creating SalesOrder via API

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

  • JAngle Profile Picture
    JAngle 33,159 on at
    RE: InvalidTableRelation error on Customer when creating SalesOrder via API

    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

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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans