Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

InvalidTableRelation error on Customer when creating SalesOrder via API

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?

Categories:
  • 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,155 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

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,558 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,647 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans