Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retention Policy: Convert total number of deleted records to BigInteger #2962

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ codeunit 3904 "Apply Retention Policy Impl."
Permissions = tabledata AllObjWithCaption = r;

var
TotalNumberOfRecordsDeleted: Integer;
TotalNumberOfRecordsDeleted: BigInteger;
EndCurrentRun: Boolean;
ApplyAllRetentionPolicies: Boolean;
IsUserInvokedRun: Boolean;
Expand Down Expand Up @@ -222,7 +222,7 @@ codeunit 3904 "Apply Retention Policy Impl."
RecordRefDuplicate: RecordRef;
RetenPolDeleting: Interface "Reten. Pol. Deleting";
Handled: Boolean;
NumberOfRecordsDeleted: Integer;
NumberOfRecordsDeleted: BigInteger;
RecordCountBefore: Integer;
RecordCountAfter: Integer;
begin
Expand Down Expand Up @@ -427,12 +427,12 @@ codeunit 3904 "Apply Retention Policy Impl."
exit(RetentionPolicyLogCategory::"Retention Policy - Apply");
end;

internal procedure MaxNumberOfRecordsToDelete(): Integer
internal procedure MaxNumberOfRecordsToDelete(): BigInteger
begin
exit(10000)
end;

internal procedure NumberOfRecordsToDeleteBuffer(): Integer
internal procedure NumberOfRecordsToDeleteBuffer(): BigInteger
begin
exit(0)
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ table 3907 "Reten. Pol. Deleting Param"
/// <summary>
/// Indicates the maximum number of records to be deleted.
/// </summary>
field(4; "Max. Number of Rec. to Delete"; Integer)
#pragma warning disable AS0004
field(4; "Max. Number of Rec. to Delete"; BigInteger)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grobyns to confirm this is not breaking partners or at least very unlikely to do so and fine to check in.

{
DataClassification = SystemMetadata;
MinValue = 0;
}
#pragma warning restore AS0004
/// <summary>
/// if set to true the event OnApplyRetentionPolicyRecordLimitExceeded will not be raised.
/// </summary>
Expand All @@ -69,13 +71,15 @@ table 3907 "Reten. Pol. Deleting Param"
DataClassification = SystemMetadata;
}
/// <summary>
/// Indicates the maximum number of records that can be deleted at the same time accross all retention policies
/// Indicates the maximum number of records that can be deleted at the same time across all retention policies
/// </summary>
field(6; "Total Max. Nr. of Rec. to Del."; Integer)
#pragma warning disable AS0004
field(6; "Total Max. Nr. of Rec. to Del."; BigInteger)
{
DataClassification = SystemMetadata;
MinValue = 0;
}
#pragma warning restore AS0004
/// <summary>
/// If true, indicates that user is applying the retention policies manually.
/// If false, the retention policies are applied by a scheduled task.
Expand All @@ -88,10 +92,12 @@ table 3907 "Reten. Pol. Deleting Param"
/// The number of records in the table before the deletion.
/// The count is calculated once before passing this table to the deletion implementation and is used to limit the number of records to be deleted as well as record the number of records actually deleted.
/// </summary>
field(8; "Record Count Before Delete"; Integer)
#pragma warning disable AS0004
field(8; "Record Count Before Delete"; BigInteger)
{
DataClassification = SystemMetadata;
}
#pragma warning restore AS0004
}

keys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,14 @@ table 3901 "Retention Policy Setup"
{
DataClassification = SystemMetadata;
}
field(100; "Number Of Records Deleted"; Integer)
#pragma warning disable AS0004
field(100; "Number Of Records Deleted"; BigInteger)
{
DataClassification = SystemMetadata;
Access = Internal;
Editable = false;
}
#pragma warning restore AS0004
}

keys
Expand Down
Loading