[29.x] - Bug 645043: [Expense Agent] Expense User with missing Employee Posting Group is exposed through the Expense Users API and gets stuck at submission - #10885
Conversation
… user Bug 645043: an expense user linked to an employee without an employee posting group was exposed through the Expense Users API and got stuck at submission. - Expense User."Employee No." validation now blocks employees without an employee posting group. - Added an "Employee Posting Group" lookup FlowField on Expense User and filtered it out in the Expense Users API OnOpenPage, for employees that lose the posting group later. - Added tests for both the blocked and the allowed link. (cherry picked from commit 686bbe8)
(cherry picked from commit 0ddb2af)
Good Sense Reviewer - Round 1Recommendation: Accept with SuggestionsWhat this PR doesThis change prevents Expense Users linked to employees without an Employee Posting Group from being usable by the agent. It adds a posting-group check when validating The root cause is addressed: new invalid links are blocked, existing bad links are hidden from the API, and the filter is added in FilterGroup 2 so it AND-combines with caller filters. The demo-data order change fits the new validation, and there is no BaseApp publisher or event dependency. Problem-solution fitFit: Strong The reported scenario is an expense user who can sign in but then cannot submit because the linked employee has no posting group. The diff matches that path by blocking new invalid links and hiding existing or later-invalid links from the API without changing unrelated Expense Agent behavior. SuggestionsS1 (🟠 Moderate): Add API filter regression test Risk assessment and necessityRisk: The regression surface is narrow: Expense User Necessity: The change is required because users without employee posting setup cannot submit expenses and should be stopped at sign-in instead. The scope is targeted and includes both prevention for new links and protection for existing or later-invalid links.
|
| OriginalFilterGroup := Rec.FilterGroup(); | ||
| Rec.FilterGroup(2); | ||
| Rec.SetFilter("Employee No.", '<>%1', ''); | ||
| Rec.SetFilter("Employee Posting Group", '<>%1', ''); |
|
1 similar comment
|
Fixes AB#648542
Problem
An expense user linked to an employee without an Employee Posting Group was returned by the Expense Users API. The agent could sign that user in, but submission/posting later failed because the posting group is required.
Changes
Expense User.Employee No.validation now errors when the employee has no employee posting group, so such a link cannot be created.Employee Posting Grouplookup FlowField (field 25) onExpense Userand filtered on it inExpense Users APIOnOpenPage(FilterGroup 2, next to the existingEmployee No.filter). This also covers employees whose posting group is removed after the link was made.Tests
ExpenseUserCannotBeLinkedToEmployeeWithoutPostingGroupExpenseUserCanBeLinkedToEmployeeWithPostingGroup