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

Community site session details

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

Custom API SourceTable property using Purchase Line vs Purch. Inv. Line Aggregate

(0) ShareShare
ReportReport
Posted on by 4
This all started when I needed to add a custom field, but because the standard api is not extendable, I created a custom api. I had asked earlier about an issue with an error for a POST request for Purchase Lines. I dug a little into the source code for the APIV2 .app source code and noticed they use a different SourceTable than I was. Wondering if that was why I am getting the error? I am using Purchase Header for the SourceTable (this can do my POST request in Postman and set my custom field) and I am using Purchase Line as the SourceTable for my Lines. I noticed in the source code they use Purch. Inv. Entity Aggregate and Purch. Inv. Line Aggregate respectively for the SourceTable in the API. Am I not using the correct SourceTables? Could this be why I am getting my error when doing a POST request for my lines? Here was the error I am getting using SourceTable Purchase Line. Do I need to switch my SourceTable to what the APIV2 .app source code is using instead Purch. Inv. Line Aggregate?
 
Response:
    "error": {
        "code": "Internal_InvalidTableRelation",
        "message": "The field Document No. of table Purchase Line contains a value (108183) that cannot be found in the related table (Purchase Header).  CorrelationId:  dcae148f-afbf-4be8-99d8-50fc86a13a3a."
    }
 
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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,683 Super User 2025 Season 2

#2
Sumit Singh Profile Picture

Sumit Singh 2,603

#3
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 2,214

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans