feat(PayablesAgent): Add inbound e-documents count and link to setup page#9060
feat(PayablesAgent): Add inbound e-documents count and link to setup page#9060Groenbech96 wants to merge 2 commits into
Conversation
|
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() |
There was a problem hiding this comment.
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
Copilot PR ReviewIteration 5 · Outcome: completed Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630 Findings by domainFindings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).
Totals: 0 knowledge-backed · 2 agent findings. Orchestrator pre-filter (13 file(s) excluded)
Findings produced by the Copilot CLI agent against BCQuality at |
3b2ba61 to
6ba0343
Compare
…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>
6ba0343 to
f413ebf
Compare
…bound-edocuments-cue
| AgentTaskList: Page "Agent Task List"; | ||
| begin | ||
| PayablesAgentSetupRec.GetSetup(); | ||
| if not IsNullGuid(PayablesAgentSetupRec."User Security Id") then |
There was a problem hiding this comment.
DrillDownAgentTasks only applies the 'Agent User Security ID' filter when the setup's User Security Id is not blank; when it is blank, AgentTask is left completely unfiltered and the drill-down opens the Agent Task List showing every agent task in the system.
This contradicts CalcAgentTasks, which displays '0 agent tasks' for the exact same blank-guid condition. A user sees 0 on the field but an unfiltered, unrelated list when they click it.
Recommendation:
- always apply the SetRange unconditionally (a blank guid filter naturally returns zero matching rows), matching CalcAgentTasks' effective behavior and removing the special-case branch.
Suggested fix (apply manually — could not be anchored as a one-click suggestion):
PayablesAgentSetupRec.GetSetup();
AgentTask.SetRange("Agent User Security ID", PayablesAgentSetupRec."User Security Id");
AgentTaskList.SetTableView(AgentTask);👍 useful · ❤️ especially valuable · 👎 wrong - reply with why
| EDocument: Record "E-Document"; | ||
| InboundEDocumentsPage: Page "Inbound E-Documents"; | ||
| begin | ||
| EDocument.SetRange(Service, PayablesAgentSetup.GetAgentEDocumentServiceCode()); |
There was a problem hiding this comment.
CalcInboundEDocuments filters E-Document by both Direction = Incoming and Service, but DrillDownInboundEDocuments filters only by Service.
Clicking the 'InboundEDocuments' field (tooltip: 'open the list of inbound e-documents') can therefore open a list that also includes outgoing e-documents for that service, contradicting both the field's label and the count shown.
Recommendation:
- add the same Direction = Incoming filter in DrillDownInboundEDocuments so the drill-down list matches the displayed count and the field's stated purpose.
Suggested fix (apply manually — could not be anchored as a one-click suggestion):
EDocument.SetRange(Direction, "E-Document Direction"::Incoming);
EDocument.SetRange(Service, PayablesAgentSetup.GetAgentEDocumentServiceCode());👍 useful · ❤️ especially valuable · 👎 wrong - reply with why
Summary
Adds an Inbound E-Documents field to the Cost section of the Payables Agent configuration dialog (page 3304).
Changes
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