Skip to content

Add Remaining Amount field and calculation to General Ledger Entries Review page#29575

Open
Bertverbeek4PS wants to merge 1 commit intomicrosoft:mainfrom
Bertverbeek4PS:issue-29469
Open

Add Remaining Amount field and calculation to General Ledger Entries Review page#29575
Bertverbeek4PS wants to merge 1 commit intomicrosoft:mainfrom
Bertverbeek4PS:issue-29469

Conversation

@Bertverbeek4PS
Copy link
Contributor

@Bertverbeek4PS Bertverbeek4PS commented Jan 12, 2026

Summary

Added remaining amount to the page "General Ledger Entries" as an extension. Calculate the amount minus the reviewed amount.

Fixes #29469
Fixes AB#618355

Copilot AI review requested due to automatic review settings January 12, 2026 13:31
@Bertverbeek4PS Bertverbeek4PS requested a review from a team as a code owner January 12, 2026 13:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds a "Remaining Amount" field to the General Ledger Entries page that displays the difference between the entry amount and the reviewed amount. This enables users to see how much of each G/L entry remains to be reviewed without navigating to the Review G/L Entries page.

Changes:

  • Added a calculated "Remaining Amount" field to the General Ledger Entries page extension
  • Implemented calculation logic in OnAfterGetRecord trigger to compute remaining amount as Amount minus Reviewed Amount

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JesperSchulz JesperSchulz added the Finance GitHub request for Finance area label Jan 14, 2026
@github-actions github-actions bot added the linked Issue is linked to a Azure Boards work item label Jan 29, 2026
@JesperSchulz JesperSchulz self-assigned this Jan 29, 2026
@JesperSchulz JesperSchulz added the processing-PR The PR is currently being reviewed label Jan 29, 2026
@github-actions
Copy link
Contributor

Processing this PR. The branch is now locked 🔒 Please don't push updates unless otherwise agreed.

Copy link
Contributor

@JesperSchulz JesperSchulz left a comment

Choose a reason for hiding this comment

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

Please take a look at the comment.


trigger OnAfterGetRecord()
begin
Rec.CalcFields("Reviewed Amount");
Copy link
Contributor

Choose a reason for hiding this comment

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

Code was flagged by agent:
Issue
CalcFields() called inside OnAfterGetRecord trigger on G/L Entry table (10M+ rows). This creates N+1 query pattern where every row displayed triggers a separate FlowField calculation query, causing severe performance degradation during page scrolling and rendering.

Recommendation
Remove explicit CalcFields() from OnAfterGetRecord. If 'Reviewed Amount' is a FlowField, bind it directly to a page field - the platform handles FlowField loading more efficiently. Ensure the FlowField's source table has a proper SIFT index (key with SumIndexFields) to optimize the aggregation. If RemainingAmount calculation is required, consider computing it only OnAfterGetCurrRecord (for the focused record) or using a query-based approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JesperSchulz
Well if I put the field on the page and people are making it invisible it would not calculate because of the feature:
" Calculate only visible FlowFields"
ANd on the OnAfterGetCurreRecord I only have the focussed record

Copy link
Contributor

Choose a reason for hiding this comment

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

Feedback from the Finance team:

This feature has given us enormous performance issues, inconsistent calculation of Amount to Review and upgrade timeouts. We will not add more calculation to it. These fields are an extension on top of GL Entry - one of the biggest tables of BC with millions of records. Extremely risky to add more calculations.

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 linked Issue is linked to a Azure Boards work item processing-PR The PR is currently being reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BC Idea]: [Review G/L Entries] Please add the field remaining amount to the page General Ledger Entries (20, List)

3 participants