Skip to content

[E-Document] Agent-driven line matching infrastructure#7546

Draft
dayland wants to merge 1 commit intomainfrom
features/607916-payables-agent-line-matching
Draft

[E-Document] Agent-driven line matching infrastructure#7546
dayland wants to merge 1 commit intomainfrom
features/607916-payables-agent-line-matching

Conversation

@dayland
Copy link
Copy Markdown
Contributor

@dayland dayland commented Apr 6, 2026

Summary

Infrastructure changes to the E-Document framework enabling agent-driven line matching. When the AgentDriven processing customization is active, the AL-based PrepareDraft pipeline is skipped so the Payables Agent can drive matching through page navigation.

  • IPrepareDraftGuard interface -- new extensibility point on E-Doc. Proc. Customizations enum allowing apps to skip PrepareDraft
  • Default guard implementation -- returns false (AL pipeline runs normally)
  • Historical Purchase Lines page -- smart data loader with priority-based filtering (same-vendor first, then cross-vendor), capped at 5,000 records
  • Draft subform line actions -- Item References, Text-to-Account Mappings, Historical Purchase Lines, Chart of Accounts, Deferral Templates (Scope = Repeater)
  • Extended idRanges -- 6243-6249 for new objects

Related NAV PR

NAV PR #244256 -- Payables Agent implementation + eval test suite (29 scenarios, 6 codeunits)

Related Work Items

AB#607916

Test plan

  • Compiles cleanly in E-Document App project
  • PrepareDraft guard correctly skips when AgentDriven is set on service
  • Historical Purchase Lines page loads with priority ordering
  • All 5 line-level navigation actions accessible from draft subform
  • CI pipeline build validation

🤖 Generated with Claude Code

Add IPrepareDraftGuard interface to allow skipping the AL-based
PrepareDraft pipeline when matching is handled by the agent.

- New IPrepareDraftGuard interface with SkipPrepareDraft() method
- Default implementation returns false (AL pipeline runs normally)
- Guard check at top of PrepareDraft procedure
- Added to E-Doc. Proc. Customizations enum with DefaultImplementation
- Extended app.json idRanges (6243-6249)

New Historical Purchase Lines page and smart data loader:
- Priority-based loader: same-vendor first, then cross-vendor
- Matching by exact product code, exact description, LLM similar descriptions
- Per-line results (different lines show different historical matches)
- Capped at 5,000 records

New line-level navigation actions on Draft Subform (Scope = Repeater):
- Item References, Text-to-Account Mappings, Historical Purchase Lines,
  Chart of Accounts, Deferral Templates
- EnsureEDocumentPurchaseHeader guard for agent session compatibility
- Allocation Account No. field on Historical Lines page

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added the AL: Apps (W1) Add-on apps for W1 label Apr 6, 2026
@github-actions github-actions bot added this to the Version 29.0 milestone Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants