Skip to content

[master] Financial Report Recalculate clears Global Dimension filters - #10179

Merged
neeleshsinghal merged 4 commits into
mainfrom
bugs/Bug-646538-Financial-Report-Recalculate-clears-Global-Dimension-filter
Aug 13, 2026
Merged

[master] Financial Report Recalculate clears Global Dimension filters#10179
neeleshsinghal merged 4 commits into
mainfrom
bugs/Bug-646538-Financial-Report-Recalculate-clears-Global-Dimension-filter

Conversation

@neeleshsinghal

@neeleshsinghal neeleshsinghal commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Workitem : Bug 646538: [Master][ALL-E] Financial Report Recalculate clears Global Dimension filters

Fixes AB#646538

Issue: Recalculating a financial report cleared the Global Dimension filters entered on the Acc. Schedule Overview page.
Cause: Recalculate reloaded persisted/default report filters, overwriting the current in-page filter values.
Solution: Preserve the current page filters during recalculation and add an automated regression test verifying the UI values and underlying FlowFilters remain unchanged.

@neeleshsinghal neeleshsinghal added the Finance GitHub request for Finance area label Aug 12, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Aug 12, 2026
…Bug-646538-Financial-Report-Recalculate-clears-Global-Dimension-filter
@neeleshsinghal
neeleshsinghal marked this pull request as ready for review August 13, 2026 01:31
@neeleshsinghal
neeleshsinghal requested a review from a team August 13, 2026 01:31

Copilot AI left a comment

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.

Pull request overview

Fixes a regression where using Recalculate on Acc. Schedule Overview overwrote the user’s currently entered Global Dimension filters by reloading persisted/default financial report filters. The change preserves in-page filter state during recalculation and adds a regression test to ensure both UI control values and underlying FlowFilters remain unchanged.

Changes:

  • Preserve the current TempFinancialReport filter state during Recalculate by skipping LoadFinancialReportFiltersOrDefault on that reload.
  • Add an automated test verifying Global Dimension 1/2 filters are retained after recalculation (copied into the relevant localized test layers).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/Layers/W1/BaseApp/Finance/FinancialReports/AccScheduleOverview.Page.al Adds a flag to preserve current page filters during Recalculate-triggered reload.
src/Layers/W1/Tests/ERM-Finance/ERMAccountSchedule.Codeunit.al Adds regression test asserting Global Dimension filters persist across Recalculate.
src/Layers/SE/Tests/ERM-Finance/ERMAccountSchedule.Codeunit.al Mirrors the regression test in SE test layer.
src/Layers/RU/Tests/ERM-Finance/ERMAccountSchedule.Codeunit.al Mirrors the regression test in RU test layer.
src/Layers/ES/Tests/ERM-Finance/ERMAccountSchedule.Codeunit.al Mirrors the regression test in ES test layer.
src/Layers/CZ/Tests/ERM-Finance/ERMAccountSchedule.Codeunit.al Mirrors the regression test in CZ test layer.
src/Layers/APAC/Tests/ERM-Finance/ERMAccountSchedule.Codeunit.al Mirrors the regression test in APAC test layer.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Layers/W1/Tests/ERM-Finance/ERMAccountSchedule.Codeunit.al
Comment thread src/Layers/SE/Tests/ERM-Finance/ERMAccountSchedule.Codeunit.al
Comment thread src/Layers/RU/Tests/ERM-Finance/ERMAccountSchedule.Codeunit.al
Comment thread src/Layers/ES/Tests/ERM-Finance/ERMAccountSchedule.Codeunit.al
Comment thread src/Layers/CZ/Tests/ERM-Finance/ERMAccountSchedule.Codeunit.al
Comment thread src/Layers/APAC/Tests/ERM-Finance/ERMAccountSchedule.Codeunit.al
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Agentic PR Review - Round 1

Recommendation: Accept with Suggestions

What this PR does

This PR changes page 490 so the Recalculate action keeps the current TempFinancialReport filter state while the page reloads, instead of loading persisted/default filters again. That addresses the root cause from the bug: ReloadPage() was overwriting filters entered during the current page session before the report was recalculated. The flag is scoped to the Recalculate path and is reset inside LoadPageState(), so normal page open, restore defaults, and other reload paths still load saved filters. The added tests exercise the changed path and verify both visible Global Dimension filters and the underlying FlowFilters are retained.

Suggestions

S1 - Verify recalculated amounts stay filtered
The new test proves the filter controls and FlowFilters are retained, but it does not assert the recalculated report amount. Add one amount assertion with entries inside and outside the selected dimension so the test proves Recalculate still uses the filter in the displayed result.

Risk assessment and necessity

Risk: This is a financial reporting page, so an incorrect fix could silently broaden financial analysis results. The code change is narrow: it only skips LoadFinancialReportFiltersOrDefault(TempFinancialReport) for the Recalculate-triggered reload, does not change table data, and does not add or change public APIs/events. Performance and concurrency risk are low because the change only reuses the existing temporary page state for the current session.

Necessity: The bug is valid and important because the work item shows standard Financial Reports can lose current Global Dimension filters on Recalculate and report unfiltered results. The chosen scope is right: preserving current page state for this one reload fixes the root cause while keeping saved/default filter loading for other paths.


[AI-PR-REVIEW] version=1 promptVersion=2 system=github pr=10179 round=1 by=alexei-dobriansky at=2026-08-13T12:45:19Z lastSha=72aa73da8760a690a0775b9fe8b5f461c1561f20 reviewKey=804fee04cce57ec6648357d34791a54b8af354add2c3e632ab6250939a195a00 suggestions=S1@5f8132ef

@neeleshsinghal
neeleshsinghal added this pull request to the merge queue Aug 13, 2026
Merged via the queue into main with commit 75b5de9 Aug 13, 2026
493 of 503 checks passed
@neeleshsinghal
neeleshsinghal deleted the bugs/Bug-646538-Financial-Report-Recalculate-clears-Global-Dimension-filter branch August 13, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants