Skip to content

Document SAP B1 fields the Service Layer rejects - #1476

Merged
helpcodeai merged 2 commits into
mainfrom
fix/sap-b1-field-hints
Nov 4, 2026
Merged

helpcodeai merged 2 commits into
mainfrom
fix/sap-b1-field-hints

Conversation

@helpcodeai

Copy link
Copy Markdown
Contributor

Summary

Production use of the SAP Business One adapter (B1 10.0 FP 2511, Service Layer v2) showed the model repeatedly sending fields and filters the Service Layer rejects with 400:

  • VendorPayments / IncomingPayments: DocTotal and header CheckSum do not exist ("Property 'CheckSum' of 'Payment' is invalid"). Our own select example suggested CheckSum. Cheque amounts are in PaymentChecks.
  • JournalEntries: UserSign, StornoToTransId, UpdateDate do not exist; $select=JournalEntryLines/AccountCode fails ("Invalid navigation property"); lambda filters JournalEntryLines/any(...) fail ("Invalid symbol in the filter condition").
  • ChartOfAccounts: Postable, PostingMode, ControlAccount do not exist; postable accounts are ActiveAccount eq 'tYES'.

The model also matched bank statement amounts by calling b1_list_vendor_payments once per amount (hundreds of calls, ~85% empty). The instructions and the payment tool descriptions now say to read the date window once and match locally.

Changes are text only (instructions, tool and parameter descriptions); no tool names, paths or parameters change. Behaviour is the same in Cloud and self-hosted.

Test plan

Run from the repository root and packages/backend:

  • node scripts/validate-adapters.mjs --warn: 708 passed, 0 failed. de/sap-business-one.json only has the existing tool-prefix warnings (tool names unchanged).
  • node scripts/regenerate-catalog.mjs: no diff in catalog.ts.
  • npx jest src/adapters/de/sap-business-one.live.spec.ts --maxWorkers=2: passed (live calls skipped).
  • catalog.spec.ts / catalog-summary.spec.ts could not run locally: the borrowed node_modules had a Prisma client generated for another schema (TS2339 on PrismaService), unrelated to this change. CI runs them.

Payments have no DocTotal or header CheckSum, journal entry lines cannot
be filtered with lambdas or selected by sub-field, and the chart of
accounts has no Postable field. Drop CheckSum from the payment select
example and tell the model to match many amounts in one read.
@helpcodeai
helpcodeai requested a review from D3nisty as a code owner November 3, 2026 08:43
@helpcodeai
helpcodeai merged commit 95e35af into main Nov 4, 2026
14 checks passed
@helpcodeai
helpcodeai deleted the fix/sap-b1-field-hints branch November 4, 2026 16:18
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant