Skip to content

[29.0][ExpenseAgent] Refactor agent setup for policies - #10958

Merged
encimita merged 1 commit into
releases/29.0from
private/encimita/backport-648729-releases-29.0
Sep 4, 2026
Merged

[29.0][ExpenseAgent] Refactor agent setup for policies#10958
encimita merged 1 commit into
releases/29.0from
private/encimita/backport-648729-releases-29.0

Conversation

@encimita

@encimita encimita commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

What & why

Backports #10956 to releases/29.0.

Expense Agent admins should be able to disallow user-run policy checks.

Linked work

Fixes AB#648729

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

The backport applies cleanly, changes only the four files from #10956, has no whitespace errors, and has the same stable patch ID as the source commit. A local AL build wasn't run because BCContainerHelper and Docker aren't installed on this machine.

Risk & compatibility

This is a direct backport of #10956 with no release-specific changes.

@encimita
encimita requested a review from a team September 2, 2026 13:10
@encimita
encimita requested a review from a team as a code owner September 2, 2026 13:10
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 Team: Finance GitHub request for Finance area labels Sep 2, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Sep 2, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Request Changes

What this PR does

This change adds a setup field and exposes it in the setup pages and setup API so admins can control whether submitters can run policy evaluation before submission. The stored setting is present, but the submitter-facing evaluation path still appears to be controlled only by Evaluate Policies, and the new field is not read by the capability or API path that enables policy evaluation.

Problem-solution fit

Fit: Partial

The reported scenario needs a real opt-out for submitter-run policy checks. The diff adds configuration UI and API shape, but it does not yet make the runtime path honor the new opt-out.

Suggestions

S1 (🔴 High): Submitter policy checks ignore the new setting
"Submitter-run Evaluation" is only stored and exposed. The submitter-facing policy evaluation capability and APIs still stay enabled when "Evaluate Policies" is true, so turning this new field off does not reliably block user-run checks. Use this field in the capability or service path that lets submitters run evaluations, while keeping automatic evaluation controlled by "Evaluate Policies".

Risk assessment and necessity

Risk: The changed setup table, setup pages, and setup API affect Expense Agent policy evaluation and AI credit use. The schema change is additive, and no BaseApp event or Sales/Purchase/Service analogue is involved, but missing enforcement leaves the new admin control ineffective.

Necessity: The change is needed to separate automatic policy evaluation from manual submitter checks. The scope is narrow, but it is incomplete until the submitter-run path uses the new setting.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=10958 round=1 by=alexei-dobriansky at=2026-09-02T19:14:53.0893143Z lastSha=1500b9309b014c8513da80bb21314d73b21aa8dd reviewKey=9936ecb4c9a0c3faaccf1c717e8d564d374ff39b8795ed24146488a8ffd963c5 suggestions=S1@5722bba0

@encimita
encimita merged commit de5af0b into releases/29.0 Sep 4, 2026
331 of 335 checks passed
@encimita
encimita deleted the private/encimita/backport-648729-releases-29.0 branch September 4, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 Team: Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants