mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-05 06:36:55 +01:00
- Scope both articles to bc-version [22..]: FindOrCreateRetentionPeriod first appears in the 21.1 System Application and OnRefreshAllowedTables in 22. - Reframe the default-setup article as optional guidance; registration without a setup is valid. The anti-pattern and review routing now cover only false claims that registration alone cleans up data. - Make all four samples self-contained: declare Contoso Activity Log in each, add the Retention Policy Setup permission, and guard the default setup on IsAllowedTable. - Let evaluation overrides list additionalArticles and register both retention pairs as extra privacy cases (38 cases, existing IDs unchanged). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
33 lines
931 B
AL
33 lines
931 B
AL
table 50567 "Contoso Activity Log"
|
|
{
|
|
DataClassification = SystemMetadata;
|
|
|
|
fields
|
|
{
|
|
field(1; "Entry No."; Integer) { AutoIncrement = true; }
|
|
field(2; "Activity"; Text[250]) { }
|
|
}
|
|
|
|
keys
|
|
{
|
|
key(PK; "Entry No.") { Clustered = true; }
|
|
}
|
|
}
|
|
|
|
codeunit 50563 "Contoso Activity Log Cleanup"
|
|
{
|
|
Access = Internal;
|
|
|
|
// The log table is never added to the allowed tables, so it cannot appear
|
|
// on the Retention Policies page. Cleanup is hard-coded here instead:
|
|
// the period is not configurable, the deletion is not written to the
|
|
// Retention Policy Log, and an administrator cannot switch it off.
|
|
trigger OnRun()
|
|
var
|
|
ContosoActivityLog: Record "Contoso Activity Log";
|
|
begin
|
|
ContosoActivityLog.SetFilter(
|
|
SystemCreatedAt, '<%1', CreateDateTime(CalcDate('<-30D>', Today()), 0T));
|
|
ContosoActivityLog.DeleteAll();
|
|
end;
|
|
}
|