-
Notifications
You must be signed in to change notification settings - Fork 686
Issue 29317 #29468
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?
Issue 29317 #29468
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 PR addresses issue #29317 by auto-filling the "Amount to Review" field with the calculated remaining amount when records are displayed on the Review G/L Entries page.
Key Changes:
- Auto-populates "Amount to Review" field when it's zero using the RemainingAmount calculation in the OnAfterGetRecord trigger
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| if Rec."Amount to Review" = 0 then | ||
| Rec."Amount to Review" := RemainingAmount; |
Copilot
AI
Nov 26, 2025
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.
Modifying Rec."Amount to Review" in OnAfterGetRecord without persisting it to the database can lead to inconsistent behavior. The CalcBalance() function (lines 402-412) iterates through all records and sums "Amount to Review", but it will only see persisted values, not the in-memory modifications made in this trigger. This means the Balance calculation may be incorrect when records have their "Amount to Review" auto-filled but not explicitly modified by the user.
Consider either:
- Persisting the change by calling
Rec.Modify()after setting the value, or - Updating
CalcBalance()to account for auto-filled values that haven't been persisted
| if Rec."Amount to Review" = 0 then | |
| Rec."Amount to Review" := RemainingAmount; | |
| if Rec."Amount to Review" = 0 then begin | |
| Rec."Amount to Review" := RemainingAmount; | |
| if not Rec.IsNew() then | |
| Rec.Modify(); | |
| end; |
| if Rec."Amount to Review" = 0 then | ||
| Rec."Amount to Review" := RemainingAmount; |
Copilot
AI
Nov 26, 2025
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.
The new auto-fill behavior for "Amount to Review" lacks test coverage. Since the repository includes comprehensive test coverage for this page (see ReviewGLEntriesTests.Codeunit.al), a test should be added to verify that:
- When "Amount to Review" is 0, it gets auto-filled with RemainingAmount
- When "Amount to Review" is non-zero, it remains unchanged
- The auto-filled value is correctly used in subsequent operations
|
Processing this PR. The branch is now locked 🔒 Please don't push updates unless otherwise agreed. |
Summary
The field 'Amount to Review' will now be filled when the page is opened with the calculated field remaining amount.
Work Item(s)
Fixes #29317
Fixes AB#615546