Skip to content

[Payables Agent] Enable historical line matching experiment#5395

Merged
ventselartur merged 20 commits intomainfrom
private/dayland/604259-update-historical-matching-to-be-experiment-2
Nov 10, 2025
Merged

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

Conversation

@dayland
Copy link
Copy Markdown
Contributor

@dayland dayland commented Nov 3, 2025

This pull request refactors the E-Doc Historical Matching feature to use experiment-based configuration instead of relying on the obsolete EDoc Historical Matching Setup table and related enums. It updates permissions, telemetry, and matching logic to support the new approach, and marks legacy configuration objects as obsolete. Conditional compilation is used to maintain compatibility with older schema versions.

Transition to experiment-based configuration:

  • Replaced usage of the EDoc Historical Matching Setup table and related enums in the historical matching logic with an experiment configuration string retrieved from the new Feature Configuration codeunit. Matching behavior (vendor scope, line scope) is now determined by experiment config values instead of table fields. [1] [2] [3] [4] [5] [6] [7] [8]

Obsolete legacy configuration objects:

  • Marked the EDoc Historical Matching Setup table and the EDoc Line Matching Scope and EDoc Vendor Matching Scope enums as obsolete, with conditional compilation to control their presence based on schema version. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Permissions and data classification updates:

  • Updated permission sets and data classification logic to handle the obsolete table and enums conditionally, ensuring proper access and warnings based on the schema version. [1] [2] [3] [4]

Telemetry improvements:

  • Enhanced telemetry logging to include experiment configuration details, such as vendor matching scope and duration, based on the new experiment-based logic.

Minor fixes and cleanup:

  • Updated error messages for clarity and added missing using System.Config; directive. [1] [2]

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.
- 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
…9-update-historical-matching-to-be-experiment-2
…rical matching

Change #if not CLEANSCHEMA31 to #if not CLEANSCHEMA30 and normalize ObsoleteTag values (set to '27.0' and '30.0') in EDocHistoricalMatchingSetup, EDocLineMatchingScope and EDocVendorMatchingScope.
…9-update-historical-matching-to-be-experiment-2
@dayland dayland requested review from a team as code owners November 3, 2025 10:09
@github-actions github-actions bot added the AL: Apps (W1) Add-on apps for W1 label Nov 3, 2025
@github-actions github-actions bot added this to the Version 28.0 milestone Nov 3, 2025
@ventselartur ventselartur requested a review from a team as a code owner November 6, 2025 09:19
@github-actions github-actions bot added the Build: Automation Workflows and other setup in .github folder label Nov 6, 2025
@github-actions github-actions bot removed the Build: Automation Workflows and other setup in .github folder label Nov 7, 2025
Jose-agg
Jose-agg previously approved these changes Nov 7, 2025
mynjj
mynjj previously approved these changes Nov 7, 2025
stkillen
stkillen previously approved these changes Nov 10, 2025
@aholstrup1 aholstrup1 removed the request for review from a team November 10, 2025 09:01
Copy link
Copy Markdown
Contributor

@ventselartur ventselartur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need resolve comments

@ventselartur ventselartur dismissed stale reviews from stkillen, mynjj, and Jose-agg via f4bb5c2 November 10, 2025 09:58
ventselartur
ventselartur previously approved these changes Nov 10, 2025
@ventselartur ventselartur merged commit cfcd8e6 into main Nov 10, 2025
49 checks passed
@ventselartur ventselartur deleted the private/dayland/604259-update-historical-matching-to-be-experiment-2 branch November 10, 2025 14:02
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.

7 participants