[Master] - [Expense Management] Move missing Employee Posting Group validation to rule violation - #11431
Conversation
… Posting Group check
|
Expense User No. now creates a non-blocking rule violation instead of failing immediately, but the branch for clearing Expense User No. does not guarantee a revalidation pass. If the user selects an employee with a blank posting group and then clears Expense User No. again before Expense Category was ever set, the previously inserted Expense Rule Violation record is left behind even though no employee is selected. Revalidate or explicitly clear expense rule violations in the blank-user branch. Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.41.6 |
Good Sense Reviewer - Round 1Recommendation: AcceptProblem-solution fit: Strong I reviewed the current diff and the linked work-item metadata for this PR in autonomous mode. I did not find a blocking correctness, data-integrity, security, or compatibility issue in the changed code. SuggestionsNone. Risk assessmentThe change is limited to the files in this PR and includes focused validation or test coverage where the scenario needs it. NecessityThe change matches the stated Finance/Expense/Sustainability scenario and is reasonable for the target branch.
|
Issue
Expense User with missing Employee Posting Group was failing with a hard error during validation and getting stuck during submission.
Cause
TestField("Employee Posting Group")was called directly during field validation on Expense and Expense Report Header, triggering hard errors rather than soft rule violations that allow users to review and resolve issues gracefully.Solution
Expense Rule Validationcodeunit for both Expenses and Expense Report lines.Employee Posting Groupis updated on Expense Report Header without annoying confirm dialogs.Employee Posting Groupon Expense Report page.ExpenseRuleViolationTest.AB#645043