Why do you need this change?
Can you please add the event OnBeforeGetPeriodStartingDate to the procedure GetPeriodStartingDate of Codeunit "Deferral Utilities" (1720)? This will be used to control the returned Date.
Describe the request
Actual Code
local procedure GetPeriodStartingDate(PostingDate: Date): Date
var
AccountingPeriod: Record "Accounting Period";
begin
if AccountingPeriod.IsEmpty() then
exit(CalcDate('<-CM>', PostingDate));
AccountingPeriod.SetFilter("Starting Date", '<%1', PostingDate);
if AccountingPeriod.FindLast() then
exit(AccountingPeriod."Starting Date");
Error(DeferSchedOutOfBoundsErr);
end;
Suggestion
local procedure GetPeriodStartingDate(PostingDate: Date): Date
var
AccountingPeriod: Record "Accounting Period";
Result: Date;
begin
OnBeforeGetPeriodStartingDate(PostingDate, Result);
if Result <> 0D then
exit(Result)
if AccountingPeriod.IsEmpty() then
exit(CalcDate('<-CM>', PostingDate));
AccountingPeriod.SetFilter("Starting Date", '<%1', PostingDate);
if AccountingPeriod.FindLast() then
exit(AccountingPeriod."Starting Date");
Error(DeferSchedOutOfBoundsErr);
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeGetPeriodStartingDate(PostingDate: Date; var Result: Date)
begin
end;
Internal work item: AB#622428
Why do you need this change?
Can you please add the event OnBeforeGetPeriodStartingDate to the procedure GetPeriodStartingDate of Codeunit "Deferral Utilities" (1720)? This will be used to control the returned Date.
Describe the request
Actual Code
Suggestion
Internal work item: AB#622428