Skip to content

Obsolete E-Document Purchase Order Matching Copilot#9572

Open
Groenbech96 wants to merge 1 commit into
microsoft:mainfrom
Groenbech96:edoc/obsolete-po-matching-copilot
Open

Obsolete E-Document Purchase Order Matching Copilot#9572
Groenbech96 wants to merge 1 commit into
microsoft:mainfrom
Groenbech96:edoc/obsolete-po-matching-copilot

Conversation

@Groenbech96

Copy link
Copy Markdown
Contributor

Summary

Obsoletes the E-Document Purchase Order Matching Copilot feature following the Business Central Obsolete lifecycle.

The five Copilot-specific objects in App/src/Processing/OrderMatching/Copilot/ are marked ObsoleteState = Pending with ObsoleteReason and ObsoleteTag = '29.0':

Object ID
E-Doc. PO Copilot Matching (codeunit) 6163
E-Doc. PO AOAI Function (codeunit) 6167
E-Doc. PO Copilot Prop (page) 6166
E-Doc. PO Match Prop. Sub (page) 6163
E-Doc. PO Match Prop. Buffer (table) 6163

This is the deprecation warning window: the objects remain functional and are stripped (#if not CLEAN29 / ObsoleteState = Removed) in a later release. Existing internal callers keep compiling — AL0432 (reference-to-pending) is a Warning in the app ruleset, which is the intended deprecation signal.

Do we need to remove the Copilot capability on upgrade?

No. The "E-Document Matching Assistance" Copilot capability is shared: besides the obsoleted Copilot matching, it is still registered and required by the active E-Doc. AI Tool Processor import flow (EDocAIToolProcessor.Setup() calls RegisterCapabilityIfNeeded() and checks IsCapabilityRegistered / IsCapabilityActive). Unregistering it on upgrade would break that live feature, so no upgrade/removal code is added.

Notes

  • The buffer table is TableType = Temporary, so there is no persisted-data migration concern.
  • The shared capability enum value and EDocAIToolProcessor are intentionally left unchanged.

@Groenbech96
Groenbech96 requested review from a team July 17, 2026 09:32
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 From Fork Pull request is coming from a fork labels Jul 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Could not find linked issues in the pull request description. Please make sure the pull request description contains a line that contains 'Fixes #' followed by the issue number being fixed. Use that pattern for every issue you want to link.

@github-actions github-actions Bot added the Integration GitHub request for Integration area label Jul 17, 2026
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 4 · Outcome: completed

Knowledge source: https://github.com/microsoft/BCQuality@186d8a131465475c79244d994acb872cd5c0d4bf

Findings by domain

Findings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).

Domain Findings Knowledge-backed Agent Inline Fallback
Agent 1 0 1 0 1

Totals: 0 knowledge-backed · 1 agent findings.

Orchestrator pre-filter (2 file(s) excluded)

  • layer-disabled (knowledge) : 2 file(s)

Findings produced by the AL review agent v1.7.3. Reply 👎 on any inline comment to flag false positives.

@Groenbech96
Groenbech96 force-pushed the edoc/obsolete-po-matching-copilot branch from 996705f to 5442028 Compare July 17, 2026 11:24
@github-actions

Copy link
Copy Markdown
Contributor

$\textbf{🟡\ Medium\ Severity\ —\ Accessibility} \quad \color{gray}{\texttt{\small Iteration\ 2}}$

With CLEAN29 defined, action MatchToOrderCopilotEnabled in EDocument.Page.al (caption 'Match Purchase Order', SparkleFilled icon) still calls EDocOrderMatch.RunMatching(Rec, true), which sets the page-level AutoRunCopilot flag in EDocOrderLineMatching.Page.al via SetAutoRunCopilot.

That flag's only consumer — the if AutoRunCopilot then ... MatchWithCopilot(false) block — is itself wrapped in #if not CLEAN29 in the same diff, so under CLEAN29 the flag becomes dead and the Copilot-branded entry point silently falls back to opening the plain manual matching page. The action's caption/icon still imply a Copilot-driven flow that no longer exists in the CLEAN29 build. Gate this action consistently (e.g. wrap it in #if not CLEAN29 or change its caption/icon/behavior) so the visible UI matches the compiled feature set.

Line mapping was unavailable, so this was posted as an issue comment.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

InherentPermissions = X;
InherentEntitlements = X;
ObsoleteState = Pending;
ObsoleteReason = 'The E-Document Purchase Order Matching Copilot has been deprecated.';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

$\textbf{🟡\ Medium\ Severity\ —\ Upgrade} \quad \color{gray}{\texttt{\small Iteration\ 2}}$

The new obsoletion metadata added across the deprecated Copilot Purchase-Order-matching objects (E-Doc.

PO AOAI Function, E-Doc. PO Copilot Matching, E-Doc. PO Copilot Prop, E-Doc. PO Match Prop. Buffer, E-Doc. PO Match Prop. Sub) all share the same ObsoleteReason: 'The E-Document Purchase Order Matching Copilot has been deprecated.' The cited guidance expects the reason to name the replacement (or explicitly state there is none) so consumers get an actionable migration path; the current text only restates that deprecation happened. Consider making the reason explicit about there being no replacement, or naming the manual/automatic matching flow as the alternative.

Knowledge:

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

@Groenbech96
Groenbech96 force-pushed the edoc/obsolete-po-matching-copilot branch from 5442028 to dfabbb8 Compare July 17, 2026 11:47
@github-actions

Copy link
Copy Markdown
Contributor

$\textbf{🟡\ Medium\ Severity\ —\ Breaking\ Changes} \quad \color{gray}{\texttt{\small Iteration\ 3}}$

In OnAfterGetRecord, the local variable EDocOrderMatch (Record "E-Doc.

Order Match") is declared unconditionally, but its only two uses (EDocOrderMatch.SetRange(...) and EDocOrderMatch.IsEmpty()) are now wrapped in #if not CLEAN29. When the CLEAN29 flag is eventually defined and this block is stripped, the declaration will remain with zero references, producing an unused-local-variable diagnostic and dead clutter. Wrap the variable declaration in the same #if not CLEAN29 guard as its usage so the whole feature (declaration + usage) is removed together when the flag flips.

Suggested fix (apply manually — could not be anchored as a one-click suggestion):

    trigger OnAfterGetRecord()
#if not CLEAN29
    var
        EDocOrderMatch: Record "E-Doc. Order Match";
#endif
    begin

Line mapping was unavailable, so this was posted as an issue comment.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

Mark the E-Document Purchase Order Matching Copilot objects as
ObsoleteState = Pending (tag 29.0) and guard the objects and all their
references with #if not CLEAN29 so they compile out of Clean builds.

The shared "E-Document Matching Assistance" Copilot capability is left
registered because it is still used by the active AI tool import flow.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Groenbech96
Groenbech96 force-pushed the edoc/obsolete-po-matching-copilot branch from dfabbb8 to 6d4475c Compare July 17, 2026 12:36
@github-actions

Copy link
Copy Markdown
Contributor

$\textbf{🟡\ Medium\ Severity\ —\ Agent} \quad \color{gray}{\texttt{\small Iteration\ 4}}$

This PR marks the E-Document Purchase Order Copilot matching feature Obsolete (ObsoleteState = Pending, tag 29.0) and guards its implementation behind #if not CLEAN29 in EDocOrderLineMatching.Page.al (action MatchCopilot / actionref MatchCopilot_Promoted), EDocPOAOAIFunction.Codeunit.al, EDocPOCopilotMatching.Codeunit.al, EDocPOCopilotProp.Page.al, EDocPOMatchPropBuffer.Table.al, and EDocPOMatchPropSub.Page.al.

However, three other live UI entry points that invoke the exact same Copilot matching flow were left completely untouched: action "MatchToOrderCopilotEnabled" in src/Apps/W1/EDocument/App/src/Document/EDocument.Page.al (line 489, calling EDocOrderMatch.RunMatching(Rec, true) at line 500), and the identically named action in src/Apps/W1/EDocument/App/src/Extensions/EDocPurchaseOrder.PageExt.al (line 69, calling RunMatching(EDocument, true) at line 83) and src/Apps/W1/EDocument/App/src/Extensions/EDocPurchaseOrderList.PageExt.al (line 54, calling RunMatching(EDocument, true) at line 68). All three pass WithCopilot = true into EDocLineMatching.Codeunit.al's RunMatching, which calls the now-Pending-obsolete EDocOrderLineMatching.Page.SetAutoRunCopilot, driving the same deprecated AI-matching path. None of these three actions carry ObsoleteState/ObsoleteReason/ObsoleteTag or a #if not CLEAN29 guard, so users continue to be offered the deprecated Copilot matching experience from these entry points with no deprecation warning, while the functionally identical action on the order-line-matching page is marked obsolete.

Recommendation:

  • apply the same ObsoleteState = Pending / ObsoleteReason / ObsoleteTag = '29.0' markers (and, if the intent is to fully retire the capability, the same #if not CLEAN29 guarding) to all three "MatchToOrderCopilotEnabled" actions and their RunMatching(..., true) call sites, so the deprecation is consistent across every entry point into the feature.

Line mapping was unavailable, so this was posted as an issue comment.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

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 From Fork Pull request is coming from a fork Integration GitHub request for Integration area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant