-
Notifications
You must be signed in to change notification settings - Fork 687
Add Remaining Amount field and calculation to General Ledger Entries Review page #29575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.
|
Processing this PR. The branch is now locked 🔒 Please don't push updates unless otherwise agreed. |
JesperSchulz
left a comment
There was a problem hiding this 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"); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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