Applies To: Work 365 (Business Central Integration)
Audience: Finance Teams | System Administrators
Overview
When linking a Work 365 invoice to Microsoft Dynamics 365 Business Central, you may see:
Error: “Error while making a request to Business Central: BadRequest. {"error":{"code":"Internal_InvalidTableRelation","message":"The field Payment Terms Id of table Sales Invoice Entity Aggregate contains a value that cannot be found in the related table (Payment Terms).”}}”
This means the Payment Terms referenced on the Work 365 invoice doesn’t exist (or isn’t mapped) in Business Central (BC), so the sync fails.
Key Concepts
Payment Terms (Work 365 / CRM): A text/list field on the invoice that represents customer payment conditions (e.g., Net 15, Net 30).
Payment Terms (BC table): Master list in BC that stores Code and Description (e.g., NET30 / Net 30). The BC Payment Terms Id on the Sales Invoice must reference a valid record here.
Link Invoice → Business Central: The Work 365 command that pushes invoice data into BC. It must resolve the invoice’s Payment Terms to a valid BC Payment Term.
How It Works
Work 365 prepares the invoice payload and includes the Payment Terms value.
Business Central validates the incoming Payment Terms Id against its Payment Terms table.
If the referenced term doesn’t exist, was renamed/deleted, or IDs changed after a sandbox refresh/migration, BC returns Internal_InvalidTableRelation and the link fails.
Root Cause
Typical reasons:
The Payment Term was created/used in Work 365 but not added in Business Central.
The corresponding Payment Term in BC was deleted, renamed, or made inactive.
An environment refresh/migration changed IDs and broke the mapping between systems.
Resolution Steps
✅ 1) Verify Payment Terms in Business Central
In BC, search for Payment Terms.
Open the list and confirm the Code/Description used on the Work 365 invoice exists.
✅ 2) If the Payment Term Is Missing — choose one
Option A — Create the missing Payment Term in Business Central
In Payment Terms, click New.
Enter Code and Description to match Work 365 (e.g., NET30 / Net 30).
Save.
Option B — Update the invoice in Work 365
Open the Invoice in Work 365.
Set Payment Terms to a value that already exists in BC.
Save.
✅ 3) Retry the Link
In the Work 365 invoice: Work 365 → Link Invoice → Business Central.
Confirm the sync completes without errors.
Use Cases
New terms introduced in Work 365 (“Net 45”) but not created in BC.
Legacy term renamed in BC (NET30 → N30) while CRM still uses Net 30.
Sandbox → Production refresh changed internal IDs; mappings weren’t revalidated.
Best Practices
Keep terms synchronized: Maintain an identical set of Payment Terms (Codes & Descriptions) in both systems.
Use stable identifiers: Standardize on codes like NET15, NET30 to reduce ambiguity.
Govern changes: When adding/editing terms in one system, replicate immediately in the other. Avoid deleting/renaming terms in use.
Monitor integrations: Review integration logs for Payment Terms or BadRequest failures.
Document mappings: Maintain an internal Work 365 ↔ BC Payment Terms mapping for audits and quick fixes.
FAQs / Common Questions
Q: Does the GUID on the invoice have to match a BC ID?
A: Practically, your invoice’s Payment Term must map to a valid BC Payment Term. Ensure consistent Codes/Descriptions across systems.
Q: Can I just rename a BC Payment Term to match Work 365?
A: You can, but renames may affect existing records. Prefer adding the missing term or aligning both systems via a controlled change.
Q: We refreshed environments and links now fail.
A: After sandbox refreshes/migrations, re-check Payment Terms in both systems and revalidate mappings—IDs and lookups often change across environments.
Q: Will fixing Payment Terms change posted invoices in BC?
A: No—this only affects the export/linking step. Posted BC invoices remain as they are.
Summary
The error indicates a Payment Term mismatch: Work 365 references a term that doesn’t exist in Business Central.
Fix it by either creating the missing term in BC or changing the Work 365 invoice to use a term that already exists in BC. Keeping Payment Terms synchronized prevents future integration failures and preserves clean financial reporting.
Screenshot Placement Indicators
BC Payment Terms list (verification)
Work 365 Invoice form (Payment Terms field)
Work 365 “Link Invoice → Business Central” action
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article