Skip to content

Add OnBefore event for approval insertion checks - #11664

Open
Darrick (darjoo) wants to merge 1 commit into
mainfrom
darjoo-approval-insertion-event
Open

Darrick (darjoo) wants to merge 1 commit into
mainfrom
darjoo-approval-insertion-event

Conversation

@darjoo

@darjoo Darrick (darjoo) commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

What & why

Extensions cannot currently skip journal insertion approval checks, even when approvals are not used. Add OnBeforePreventInsertRecIfOpenApprovalEntryExist(Variant: Variant; var IsHandled: Boolean) to Approvals Mgmt. before record conversion and approval checks. Subscribers can set IsHandled to bypass the procedure; otherwise, its existing logic is unchanged.

Linked work

Fixes microsoft/ALAppExtensions#29214

AB#606350

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) 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.

What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)

  • git diff --check passed.
  • A PowerShell source-contract check confirmed the publisher signature, a local IsHandled initialized to false, and the handled exit before RecRef.GetTable. Removing the new guard and publisher reproduced the original source, confirming the existing approval logic was not changed.
  • Build and Business Central runtime validation remain pending; no AL compiler or Docker command was available in this environment. No AL tests were added. The PR remains a draft pending those checks.

Risk & compatibility

Additive integration event. Existing approval and cancellation behavior is unchanged unless a subscriber explicitly handles the event. No schema, permission, or upgrade changes.

Allow subscribers to bypass record conversion and approval checks using IsHandled while preserving the existing unhandled behavior.

AB#606350

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@darjoo
Darrick (darjoo) marked this pull request as ready for review September 21, 2026 13:26
@darjoo
Darrick (darjoo) requested a review from a team as a code owner September 21, 2026 13:26
@github-actions github-actions Bot added the Team: Integrations GitHub request for Integrations area label Sep 21, 2026
@github-actions github-actions Bot added this to the Version 30.0 milestone Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team: Integrations GitHub request for Integrations area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add OnBefore Event Publisher for Approvals Mgmt. PreventInsertRecIfOpenApprovalEntryExist

1 participant