Please add the following Event/-s OnAfterApplyRetentionPolicy to procedure ApplyRetentionPolicy in Codeunit 3904 Apply Retention Policy Impl.
ApplyRetentionPolicy(UserInvokedRun: Boolean)
var
RetentionPolicySetup: Record "Retention Policy Setup";
RetentionPolicyLog: Codeunit "Retention Policy Log";
Dialog: Dialog;
begin
RetentionPolicyLog.LogInfo(LogCategory(), AppendStartedByUserMessage(StartApplyRetentionPoliciesInfoLbl, UserInvokedRun));
ApplyAllRetentionPolicies := true;
RetentionPolicySetup.SetRange(Enabled, true);
RetentionPolicySetup.SetRange(Manual, false);
if RetentionPolicySetup.FindSet(false) then begin
if GuiAllowed() then begin
Dialog.HideSubsequentDialogs(true);
Dialog.Open(WaitDialogMsg);
end;
repeat
if UserInvokedRun then
// allow errors to bubble up
ApplyRetentionPolicy(RetentionPolicySetup, false, UserInvokedRun)
else
// suppress errors
SafeApplyRetentionPolicy(RetentionPolicySetup)
until (RetentionPolicySetup.Next() = 0) or EndCurrentRun;
if GuiAllowed() then
Dialog.Close();
end;
RetentionPolicyLog.LogInfo(LogCategory(), AppendStartedByUserMessage(EndApplyRetentionPoliciesInfoLbl, UserInvokedRun));
if ContinueWithRerun then
Codeunit.Run(Codeunit::"Apply Retention Policy Impl.");
OnAfterApplyRetentionPolicy(UserInvokedRun); <-- NEW EVENT
end;
[IntegrationEvent(false, false)]
local procedure OnAfterApplyRetentionPolicy(UserInvokedRun: Boolean)
begin
end;
Additional context
IMPORTANT ADDITION
We need a way to read the records in the Retention Policy Log Entry table based on the session ID. The table is currently set to Internal.
Would a change be possible?
Affects the table Retention Policy Log Entry (ID 3905)
Internal work item: AB#543568
Describe the request
Please add the following Event/-s OnAfterApplyRetentionPolicy to procedure ApplyRetentionPolicy in Codeunit 3904 Apply Retention Policy Impl.
Additional context
IMPORTANT ADDITION
We need a way to read the records in the Retention Policy Log Entry table based on the session ID. The table is currently set to Internal.
Would a change be possible?
Affects the table Retention Policy Log Entry (ID 3905) Internal work item: AB#543568