Skip to content

Let subscribers override the half-year new year date in SetHalfYearConventionMethod - #10337

Open
Jatin Kumar (Explorer986) wants to merge 1 commit into
mainfrom
private/kumarjatin/646465
Open

Let subscribers override the half-year new year date in SetHalfYearConventionMethod#10337
Jatin Kumar (Explorer986) wants to merge 1 commit into
mainfrom
private/kumarjatin/646465

Conversation

@Explorer986

@Explorer986 Jatin Kumar (Explorer986) commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

What & why

Codeunit 5611 raises OnBeforeSetHalfYearConventionMethod, but NewYearDate was passed by value and then always overwritten with the accounting period start. So a subscriber could set it, but it never took effect.

This keeps the existing event signature unchanged and appends a trailing var NewYearDateOverride parameter. When a subscriber sets it, the base uses that date instead of the accounting period start. With no subscriber the behavior is unchanged. The same change is applied to every copy of codeunit 5611, so the event behaves the same across the W1, FR, GB, IT, and RU layers.

Fixes AB#646465

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

No test added since this is an additive event parameter with existing coverage.

Risk & compatibility

Additive and non-breaking. The existing event keeps its shipped signature, a trailing var NewYearDateOverride parameter is appended, and existing subscribers that omit it continue to compile.

@Explorer986
Jatin Kumar (Explorer986) requested a review from a team August 18, 2026 07:19
@github-actions github-actions Bot added the Finance GitHub request for Finance area label Aug 18, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Aug 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

$\textbf{🟠\ High\ Severity\ —\ Events}$

All five country-layer copies (FR/GB/IT/RU/W1) of codeunit 5611 "Calculate Normal Depreciation" change the shipped IntegrationEvent OnBeforeSetHalfYearConventionMethod's existing NewYearDate parameter from by-value (NewYearDate: Date) to by-reference (var NewYearDate: Date). Even though the publisher is local, its name, type, and value-vs-var passing mode are a subscriber compatibility contract once shipped: existing extensions with a subscriber bound to the old by-value signature will fail to compile against the new var signature and must be updated. The intent (letting a subscriber pre-set NewYearDate so it isn't overwritten by AccountingPeriod."Starting Date") is reasonable, but it should be delivered by adding a new event/parameter rather than flipping the passing mode of an existing shipped parameter, per BCQuality's event-compatibility and published-signature guidance.

Knowledge:

Line mapping was unavailable, so this was posted as an issue comment.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.33.4

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants