Skip to content

[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

Open
v-rohangarg20 wants to merge 2 commits into
releases/29.xfrom
bugs/645043-expense-user-employee-posting-group-29x
Open

[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
v-rohangarg20 wants to merge 2 commits into
releases/29.xfrom
bugs/645043-expense-user-employee-posting-group-29x

Conversation

@v-rohangarg20

@v-rohangarg20 v-rohangarg20 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

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.
  • Added the Employee Posting Group lookup FlowField (field 25) on Expense User and filtered on it in Expense Users API OnOpenPage (FilterGroup 2, next to the existing Employee No. filter). This also covers employees whose posting group is removed after the link was made.
  • Updated Expense Agent demo-data ordering so employees receive posting groups before expense users are linked.

Tests

  • ExpenseUserCannotBeLinkedToEmployeeWithoutPostingGroup
  • ExpenseUserCanBeLinkedToEmployeeWithPostingGroup

… 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)
@v-rohangarg20
v-rohangarg20 requested a review from a team September 1, 2026 10:46
@v-rohangarg20
v-rohangarg20 requested a review from a team as a code owner September 1, 2026 10:46
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 Team: Finance GitHub request for Finance area labels Sep 1, 2026
@github-actions github-actions Bot added this to the Version 29.1 milestone Sep 1, 2026
@v-rohangarg20 v-rohangarg20 changed the title [Bug 645043] [29.x] Expense Agent: require Employee Posting Group when linking an expense user [29.x] Expense Agent: require Employee Posting Group when linking an expense user Sep 1, 2026
@Alexander-Ya Alexander Yakunin (Alexander-Ya) added ExpenseManagement and removed Team: Finance GitHub request for Finance area labels Sep 1, 2026
@github-actions github-actions Bot added the Team: Finance GitHub request for Finance area label Sep 1, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Accept with Suggestions

What this PR does

This 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 Employee No. and filters the API on a new Employee Posting Group FlowField, so users that were linked earlier but later lost setup are also hidden.

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 fit

Fit: 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.

Suggestions

S1 (🟠 Moderate): Add API filter regression test
Please extend Expense Users API Test to cover an Expense User whose linked Employee loses Employee Posting Group. That is the API path changed here, and it proves the gateway will hide legacy or later-invalid users instead of only blocking new links.

Risk assessment and necessity

Risk: The regression surface is narrow: Expense User Employee No. validation, Expense Users API visibility, and country demo-data ordering. The main compatibility risk is that records with a blank Employee Posting Group are now blocked or hidden, which matches the intended setup requirement; no public API field or event signature is changed.

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.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=10885 round=1 by=alexei-dobriansky at=2026-09-01T13:20:12Z lastSha=ff2f7bd8253d1e00ac18353802823e101e6089b4 reviewKey=3db84468fadb68288e87514a624074c8ffe2e0cf6c5697197843a206f20577bd suggestions=S1@d43527cd

@v-rohangarg20 v-rohangarg20 changed the title [29.x] Expense Agent: require Employee Posting Group when linking an expense user [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 Sep 1, 2026
OriginalFilterGroup := Rec.FilterGroup();
Rec.FilterGroup(2);
Rec.SetFilter("Employee No.", '<>%1', '');
Rec.SetFilter("Employee Posting Group", '<>%1', '');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same comment as:
#10804 (review)

@AndersLarsenMicrosoft Anders (AndersLarsenMicrosoft) added Ownership: Manual Preserve the manually selected team ownership Ownership: Needs Review Ownership is Other, low confidence, or needs manual correction and removed Team: Finance GitHub request for Finance area labels Sep 4, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

⚠️ Stale Status Check Deleted

The Pull Request Build workflow run for this PR was older than 72 hours and has been deleted.

📋 Why was it deleted?

Status checks that are too old may no longer reflect the current state of the target branch. To ensure this PR is validated against the latest code and passes up-to-date checks, a fresh build is required.


🔄 How to trigger a new status check:

  1. 📤 Push a new commit to the PR branch, or
  2. 🔁 Close and reopen the PR

This will automatically trigger a new Pull Request Build workflow run.

1 similar comment
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ Stale Status Check Deleted

The Pull Request Build workflow run for this PR was older than 72 hours and has been deleted.

📋 Why was it deleted?

Status checks that are too old may no longer reflect the current state of the target branch. To ensure this PR is validated against the latest code and passes up-to-date checks, a fresh build is required.


🔄 How to trigger a new status check:

  1. 📤 Push a new commit to the PR branch, or
  2. 🔁 Close and reopen the PR

This will automatically trigger a new Pull Request Build workflow run.

@v-rohangarg20 v-rohangarg20 removed the AL: Apps (W1) Add-on apps for W1 label Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ExpenseManagement Ownership: Manual Preserve the manually selected team ownership Ownership: Needs Review Ownership is Other, low confidence, or needs manual correction

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants