Skip to content

Commit 370b7e8

Browse files
committed
The number of records deleted are doubled every run (#3281)
Every time SafeApplyRetentionPolicy is called, the number of records deleted more than doubles. This is because we first set number of deleted records to the number already deleted ex. 1000, then cleanup records (it will increase this value further say it deletes 100, now 1100), then TotalNumberOfRecordsDeleted is incremented to 2100 instead of just 1100. Fixes [AB#571294](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/571294)
1 parent 73fcfb8 commit 370b7e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/System Application/App/Retention Policy/src/Apply Retention Policy/ApplyRetentionPolicyImpl.Codeunit.al

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ codeunit 3904 "Apply Retention Policy Impl."
183183
RetentionPolicyLog.LogError(LogCategory(), StrSubstNo(ErrorOccuredDuringApplyErrLbl, RetentionPolicySetup."Table Id", RetentionPolicySetup."Table Caption", GetLastErrorText()), false);
184184
exit
185185
end;
186-
TotalNumberOfRecordsDeleted += TempRetentionPolicySetup."Number Of Records Deleted";
186+
TotalNumberOfRecordsDeleted := TempRetentionPolicySetup."Number Of Records Deleted";
187187
end;
188188

189189
local procedure CanApplyRetentionPolicy(var RetentionPolicySetup: Record "Retention Policy Setup"; Manual: Boolean): Boolean

0 commit comments

Comments
 (0)