Skip to content

Commit

Permalink
[releases/24.3] fixes an issue where a subscriber can no longer chang…
Browse files Browse the repository at this point in the history
…e the result from GetNextNo or PeekNextNo. The fix is for obsolete code only. (#1461)

This pull request backports #1446 to releases/24.3

Fixes AB#540016
  • Loading branch information
grobyns authored Jul 5, 2024
1 parent b8e42d2 commit a4acf83
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ codeunit 396 NoSeriesManagement
end;

[Obsolete('This is a temporary method for compatibility only. Please use the "No. Series" codeunit instead', '24.0')]
internal procedure RaiseObsoleteOnAfterGetNextNo3(NoSeriesLine: Record "No. Series Line"; ModifySeries: Boolean)
internal procedure RaiseObsoleteOnAfterGetNextNo3(var NoSeriesLine: Record "No. Series Line"; ModifySeries: Boolean)
begin
OnAfterGetNextNo3(NoSeriesLine, ModifySeries);
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ codeunit 304 "No. Series - Impl."
#if not CLEAN24
#pragma warning disable AL0432, AA0205
Result := NoSeriesSingle.GetNextNo(NoSeriesLine, UsageDate, HideErrorsAndWarnings);
if Result <> NoSeriesLine."Last No. Used" then
NoSeriesLine."Last No. Used" := Result;
NoSeriesManagement.RaiseObsoleteOnAfterGetNextNo3(NoSeriesLine, true);
exit(Result);
exit(NoSeriesLine."Last No. Used");
#pragma warning restore AL0432, AA0205
#else
exit(NoSeriesSingle.GetNextNo(NoSeriesLine, UsageDate, HideErrorsAndWarnings))
Expand Down Expand Up @@ -281,8 +283,10 @@ codeunit 304 "No. Series - Impl."
#if not CLEAN24
#pragma warning disable AL0432, AA0205
Result := NoSeriesSingle.PeekNextNo(NoSeriesLine, UsageDate);
if Result <> NoSeriesLine."Last No. Used" then
NoSeriesLine."Last No. Used" := Result;
NoSeriesManagement.RaiseObsoleteOnAfterGetNextNo3(NoSeriesLine, false);
exit(Result);
exit(NoSeriesLine."Last No. Used");
#pragma warning restore AL0432, AA0205
#else
exit(NoSeriesSingle.PeekNextNo(NoSeriesLine, UsageDate));
Expand Down

0 comments on commit a4acf83

Please sign in to comment.