Skip to content

feat(PayablesAgent): Add inbound e-documents count and link to setup page#9060

Open
Groenbech96 wants to merge 1 commit into
mainfrom
fix/payables-agent-inbound-edocuments-cue
Open

feat(PayablesAgent): Add inbound e-documents count and link to setup page#9060
Groenbech96 wants to merge 1 commit into
mainfrom
fix/payables-agent-inbound-edocuments-cue

Conversation

@Groenbech96

@Groenbech96 Groenbech96 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an Inbound E-Documents field to the Cost section of the Payables Agent configuration dialog (page 3304).

Changes

  • Setup page: New clickable field showing "Based on X inbound e-documents" that drills down to the Inbound E-Documents list page, filtered to documents created by the agent (Service = 'AGENT').
  • Setup codeunit: New \GetAgentEDocumentServiceCode()\ procedure exposing the agent service code for filtering.

Motivation

PM feedback: the configuration page should show users how many e-documents the agent has processed and let them navigate directly to those documents.

Files changed

File Change
\PayablesAgentSetup.Page.al\ Added InboundEDocuments field, CalcInboundEDocuments/DrillDownInboundEDocuments procedures, variable and label
\PayablesAgentSetup.Codeunit.al\ Added GetAgentEDocumentServiceCode() procedure

@Groenbech96 Groenbech96 requested a review from a team July 3, 2026 07:35
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Could not find a linked ADO work item. Please link one by using the pattern 'AB#' followed by the relevant work item number. You may use the 'Fixes' keyword to automatically resolve the work item when the pull request is merged. E.g. 'Fixes AB#1234'

InboundEDocumentsText := StrSubstNo(InboundEDocumentsLbl, EDocCount);
end;

local procedure DrillDownInboundEDocuments()

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\ —\ Agent} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

CalcInboundEDocuments counts E-Document rows filtered by both Direction = Incoming and Service, and the field caption states 'Based on %1 inbound e-documents'.

DrillDownInboundEDocuments, invoked from the same field's OnDrillDown, only filters by Service before calling Page "Inbound E-Documents".SetTableView and Run. Page.SetTableView replaces the target page's own SourceTableView (which itself filters Direction = Incoming on page 6105), so the drill-down list will include both inbound and outbound e-documents for the service, not just the inbound ones the displayed count promises. Impact would otherwise be major (visible user-facing mismatch between the shown count and the drilled-down list), but is capped to minor per agent-finding rules.

Recommendation:

  • add EDocument.SetRange(Direction, "E-Document Direction"::Incoming) in DrillDownInboundEDocuments to match the count's filter.

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

    local procedure DrillDownInboundEDocuments()
    var
        EDocument: Record "E-Document";
        InboundEDocuments: Page "Inbound E-Documents";
    begin
        EDocument.SetRange(Direction, "E-Document Direction"::Incoming);
        EDocument.SetRange(Service, PayablesAgentSetup.GetAgentEDocumentServiceCode());
        InboundEDocuments.SetTableView(EDocument);
        InboundEDocuments.Run();
    end;

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

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 4 · Outcome: completed

Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630

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

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

Findings produced by the Copilot CLI agent against BCQuality at 822cae1b2771ac25f665f73369f69093bd4fd630. Reply 👎 on any inline comment to flag false positives.

@Groenbech96 Groenbech96 force-pushed the fix/payables-agent-inbound-edocuments-cue branch 2 times, most recently from 3b2ba61 to 6ba0343 Compare July 3, 2026 08:48
…page

Show the number of inbound e-documents processed by the agent in the
Cost section of the configuration dialog, with a drilldown link to the
Inbound E-Documents page filtered to agent-created documents.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Groenbech96 Groenbech96 force-pushed the fix/payables-agent-inbound-edocuments-cue branch from 6ba0343 to f413ebf Compare July 3, 2026 11:34
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.

1 participant