Skip to content

Align the Vend. Entry-Edit post-modify event with its Cust. Entry-Edit counterpart#9098

Merged
AndersLarsenMicrosoft merged 1 commit into
microsoft:mainfrom
Franco111000:fix-8316-vend-entry-edit-modify-event
Jul 9, 2026
Merged

Align the Vend. Entry-Edit post-modify event with its Cust. Entry-Edit counterpart#9098
AndersLarsenMicrosoft merged 1 commit into
microsoft:mainfrom
Franco111000:fix-8316-vend-entry-edit-modify-event

Conversation

@Franco111000

@Franco111000 Franco111000 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

What & why

Codeunit 113 "Vend. Entry-Edit" raises OnRunOnAfterVendLedgEntryMofidy after the vendor ledger entry is modified. The event name is misspelled, and it only exposes the modified entry. Its counterpart in codeunit 103 "Cust. Entry-Edit", OnRunOnAfterCustLedgEntryModify, passes both the record given to the codeunit and the modified entry, so vendor-side subscribers get less context than customer-side subscribers for the same hook point.

This change adds OnRunOnAfterVendLedgEntryModify with the exact shape of the customer event (both records passed by var, XML documentation mirroring the customer wording) and obsoletes the misspelled event with the standard #if not CLEAN29 pattern. The misspelled event is still declared and raised until cleanup, so existing subscribers keep working and get the usual obsolete warning pointing to the replacement. The country layers that carry full copies of the codeunit (APAC, CH, IT, NA, NL, NO, RU) receive the identical change, following the established practice of propagating W1 fixes to the localization layers.

Linked work

Fixes #8316

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

  • Verified the new event signature is a one-to-one mirror of OnRunOnAfterCustLedgEntryModify in codeunit 103: first parameter is the record passed to the codeunit, second is the modified entry, both by var, raised immediately after Modify().
  • Searched the whole repository for references to OnRunOnAfterVendLedgEntryMofidy: the only occurrences are the declaration and the raise in the eight copies of the codeunit itself. No app or test subscribes to it, so the obsoletion cannot break in-repo code.
  • The obsoletion follows the pattern already used in the repository for replaced events (obsolete attribute and old raise wrapped in #if not CLEAN29, new event raised unconditionally), for example OnBeforeCalculateAndGetPlanningCompList in CalcItemPlanPlanWksh.Codeunit.al from the 27.0 wave.
  • Confirmed the diff is uniform across W1 and the seven layer copies and contains only the two blocks per file (call site and event declarations).
  • No tests added: the change is an additive integration event plus a guarded obsoletion, with no behavior change when no subscriber is registered. The customer counterpart event has no dedicated test either.
  • I did not build the Base Application locally; the change is event-only and relies on CI for compilation across all layers.

Risk & compatibility

  • No breaking change: the misspelled event remains declared and raised until CLEAN29, so external subscribers keep working while the obsolete warning steers them to the replacement.
  • The new event is raised at the same execution point as the old one, right after Modify() and before Rec := VendLedgEntry, so both events observe the same record state.
  • None beyond that: no object signatures, table schema, or permissions are affected.

Fixes AB#641574

…unterpart

Codeunit 113 raised the misspelled OnRunOnAfterVendLedgEntryMofidy event with only the modified entry, while codeunit 103 raises OnRunOnAfterCustLedgEntryModify with both the record passed to the codeunit and the modified entry. Add OnRunOnAfterVendLedgEntryModify with the same shape as the customer event and obsolete the misspelled event, keeping it raised until CLEAN29. Applied to W1 and all country layer copies.
@Franco111000 Franco111000 requested a review from a team July 5, 2026 11:22
@github-actions github-actions Bot added From Fork Pull request is coming from a fork needs-approval Workflow runs require maintainer approval to start labels Jul 5, 2026
@JesperSchulz JesperSchulz added the Finance GitHub request for Finance area label Jul 7, 2026
Comment thread src/Layers/W1/BaseApp/Purchases/Payables/VendEntryEdit.Codeunit.al
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 1 · Outcome: completed

Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630

Findings by domain

Findings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).

Domain Findings Knowledge-backed Agent Inline Fallback
Agent 1 0 1 1 0

Totals: 0 knowledge-backed · 1 agent findings.

Orchestrator pre-filter (13 file(s) excluded)

  • layer-disabled (knowledge) : 13 file(s)

Findings produced by the Copilot CLI agent against BCQuality at 822cae1b2771ac25f665f73369f69093bd4fd630. Reply 👎 on any inline comment to flag false positives.

@github-actions github-actions Bot removed the needs-approval Workflow runs require maintainer approval to start label Jul 7, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Agentic PR Review - Round 1

Recommendation: Accept

What this PR does

This PR adds the correctly named OnRunOnAfterVendLedgEntryModify event to all in-repo Vend. Entry-Edit BaseApp copies and keeps the misspelled OnRunOnAfterVendLedgEntryMofidy event obsolete under #if not CLEAN29.

The new vendor event matches the Cust. Entry-Edit counterpart in the important parts: it is raised immediately after Modify(), before Rec := ..., and it passes the record given to the codeunit plus the modified ledger entry, both by var. The old event is still raised for non-clean builds, so current subscribers keep compiling while new subscribers can move to the aligned event.

Suggestions

No blocking or optional suggestions.

Risk assessment and necessity

Risk: This is a public BaseApp integration event change, so subscriber compatibility is the main risk. I verified the publishers and call sites in src/Layers/**/BaseApp/Purchases/Payables/VendEntryEdit.Codeunit.al; the old misspelled event remains declared and raised under #if not CLEAN29, and the new event is additive.

Necessity: No AB# work item is linked, so there is no ADO work item type or [AI-REPRO] comment to use. GitHub issue #8316 clearly describes the customer/vendor asymmetry, and the change scope is limited to aligning that event across the affected BaseApp copies. Tests are not a blocker for this event-only alignment because behavior is unchanged without subscribers.


[AI-PR-REVIEW] version=1 system=github pr=9098 round=1 by=alexei-dobriansky at=2026-07-07 lastSha=d12c91115d38a7ba46e5aa4cc6663e1bf1abeed1 suggestions=none

@JesperSchulz JesperSchulz added the Linked Issue is linked to a Azure Boards work item label Jul 7, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 7, 2026
@AndersLarsenMicrosoft AndersLarsenMicrosoft added this pull request to the merge queue Jul 9, 2026
Merged via the queue into microsoft:main with commit 316af65 Jul 9, 2026
325 of 331 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Finance GitHub request for Finance area From Fork Pull request is coming from a fork Linked Issue is linked to a Azure Boards work item

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: "Vend. Entry-Edit" wrong Event, not the same as in "Cust. Entry-Edit" (Latest BC Insider W1 29.0.50796.0)

4 participants