Skip to content

[Payables Agent] Enable historical line matching experiment #5227

Merged
dayland merged 9 commits intomainfrom
private/dayland/604259-update-historical-matching-to-be-experiment-2
Oct 30, 2025
Merged

[Payables Agent] Enable historical line matching experiment #5227
dayland merged 9 commits intomainfrom
private/dayland/604259-update-historical-matching-to-be-experiment-2

Conversation

@dayland
Copy link
Copy Markdown
Contributor

@dayland dayland commented Oct 20, 2025

This pull request removes the legacy EDoc Historical Matching Setup configuration and related enums, replacing them with a new experiment-based configuration system for historical matching. The changes simplify the matching logic and centralize configuration management, making it easier to run experiments and maintain the codebase. Permissions and data classification for the old setup are removed, and code has been refactored to use the new configuration approach.

Removal of legacy configuration and permissions

  • The EDoc Historical Matching Setup table and related enums (EDoc Vendor Matching Scope, EDoc Line Matching Scope) are marked as obsolete and removed from permissionsets and data classification. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Refactoring to experiment-based configuration

  • The historical matching logic in EDocHistoricalMatching.Codeunit.al is refactored to use experiment configuration via Configuration Management instead of the legacy setup table, affecting data loading, telemetry, and user message generation. [1] [2] [3] [4] [5] [6] [7] [8]

Simplification of matching logic

  • The matching procedures no longer depend on legacy configuration records and enums, streamlining logic for collecting matches and processing similar descriptions. [1] [2]

Update to draft preparation logic

  • The PreparePurchaseEDocDraft.Codeunit.al code is simplified to remove references to the legacy setup and now always uses the new experiment-based matching for historical data. [1] [2]

Obsolete attributes and warnings

  • Obsolete attributes and pragma warnings are added to the removed table and enums to indicate their deprecation and replacement by experiment-based matching. [1] [2] [3] [4] [5] [6]

Fixes AB#604259

…and remove setup table usage

- Replace usage of the "EDoc Historical Matching Setup" table with experiment/config-based control:
  - Add ConfigurationManagement usage and read HistoricalMatchingConfig in the historical-matching codeunit.
  - Pass HistoricalMatchingConfig through prepare/load/create-user-message flows and use it to decide vendor scope and matching behavior.
  - Adjust telemetry and JSON payload to reflect experiment-based settings.

- Mark "EDoc Historical Matching Setup" table obsolete and add pragma restore.
- Remove IsEDocHistoricalMatchingWithLLMActive and related setup checks from E-Documents setup and subscribers.
- Remove EDoc Historical Matching Setup from permission sets and data-classification handling.
- Simplify CopilotLineMatching: stop passing VendorNo and always invoke the "E-Doc. Historical Matching" codeunit for non-empty lines.

Refactor and cleanup to move from setup-table-driven behavior to experiment/config-driven historical matching.
@github-actions github-actions bot added the AL: Apps (W1) Add-on apps for W1 label Oct 20, 2025
@github-actions github-actions bot added this to the Version 28.0 milestone Oct 20, 2025
@dayland dayland marked this pull request as ready for review October 21, 2025 07:58
@dayland dayland requested review from a team as code owners October 21, 2025 07:58
- Grant table access ("EDoc Historical Matching Setup" = X) in "E-Doc. Core - Objects"
- Grant read access (tabledata = R) in "E-Doc. Core - Read"
- Grant IMD access (tabledata = IMD) in "E-Doc. Core - User"
… historical matching setup

Set ObsoleteTag to '28.0' for vendor/line matching enums and update table handling.
Wrap files with CLEANSCHEMA28 conditional and introduce CLEAN28 branch for the table
to mark it as Removed with ObsoleteTag '33.0' when appropriate. Remove AL0432 pragma
disable/restore lines.
…9-update-historical-matching-to-be-experiment-2
… config, and telemetry

- Guard references to "EDoc Historical Matching Setup" with #if not CLEAN28 and surround them with #pragma warning disable/restore AL0432 in permission sets, subscribers and table usages to avoid AL0432 when the table is removed.
- Add/restore #pragma warning disable/restore AS0105 around enum field declarations and internal procedure in EDocHistoricalMatchingSetup table to satisfy analyzer.
- Add using Microsoft.eServices.EDocument.Processing.AI in E-Document Subscribers and conditionally call DataClassificationEvalData.SetTableFieldsToNormal for the historical matching setup.
- Update E-Doc. Historical Matching codeunit:
  - Clarify error label to reference "e-document line" instead of "e-document".
  - Use FeatureConfiguration.GetConfiguration instead of ConfigurationManagement.GetConfiguration.
  - Rename telemetry dimension 'Duration (ms)' to 'Duration'.
…dayland/604259-update-historical-matching-to-be-experiment-2
@dayland dayland merged commit e0e273b into main Oct 30, 2025
47 checks passed
@dayland dayland deleted the private/dayland/604259-update-historical-matching-to-be-experiment-2 branch October 30, 2025 11:01
mazhelez added a commit that referenced this pull request Oct 30, 2025
@dayland dayland restored the private/dayland/604259-update-historical-matching-to-be-experiment-2 branch October 30, 2025 12:40
mazhelez added a commit that referenced this pull request Oct 30, 2025
…5227)" (#5372)

This reverts commit e0e273b.
as it break the CICD build:

> Compilation started for project 'E-Document Core' containing '294'
files at '11:52:20.590'.
Error: AS0074 Found Obsolete Tag with value '27.0' in the baseline and
value '28.0' in current branch for Enum 'EDoc Vendor Matching Scope'.
Obsolete Tag must be the same across branches.
Error: AS0074 Found Obsolete Tag with value '27.0' in the baseline and
value '28.0' in current branch for Table 'EDoc Historical Matching
Setup'. Obsolete Tag must be the same across branches.
Error: AS0074 Found Obsolete Tag with value '27.0' in the baseline and
value '28.0' in current branch for Enum 'EDoc Line Matching Scope'.
Obsolete Tag must be the same across branches.
  Compilation ended at '11:52:41.248'.


[AB#604259](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/604259)
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.

4 participants