mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-07 15:46:55 +01:00
Address second review round on retention policy knowledge
- 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>
This commit is contained in:
parent
4bef582ffe
commit
07a171386d
10 changed files with 177 additions and 30 deletions
|
|
@ -1,18 +1,82 @@
|
|||
table 50569 "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; }
|
||||
}
|
||||
}
|
||||
|
||||
page 50570 "Contoso Activity Log"
|
||||
{
|
||||
PageType = List;
|
||||
ApplicationArea = All;
|
||||
UsageCategory = Lists;
|
||||
SourceTable = "Contoso Activity Log";
|
||||
Editable = false;
|
||||
// Registration only makes the table selectable on the Retention Policies
|
||||
// page. No Retention Policy Setup exists and nothing is deleted, yet the
|
||||
// page tells the administrator that cleanup is running.
|
||||
AboutTitle = 'About the activity log';
|
||||
AboutText = 'Entries older than six months are deleted automatically, so the log never needs manual cleanup.';
|
||||
|
||||
layout
|
||||
{
|
||||
area(Content)
|
||||
{
|
||||
repeater(Entries)
|
||||
{
|
||||
field("Entry No."; Rec."Entry No.") { ToolTip = 'Specifies the entry number.'; }
|
||||
field(Activity; Rec.Activity) { ToolTip = 'Specifies the logged activity.'; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
codeunit 50565 "Contoso Reten. Pol. Register"
|
||||
{
|
||||
Subtype = Install;
|
||||
Access = Internal;
|
||||
|
||||
// The table becomes selectable on the Retention Policies page and nothing
|
||||
// else happens: no Retention Policy Setup record is created, so no period
|
||||
// is proposed and no data is ever deleted. The log table keeps growing
|
||||
// until someone notices the tenant's storage consumption.
|
||||
trigger OnInstallAppPerCompany()
|
||||
procedure AddAllowedTables()
|
||||
var
|
||||
ContosoActivityLog: Record "Contoso Activity Log";
|
||||
RetenPolAllowedTables: Codeunit "Reten. Pol. Allowed Tables";
|
||||
begin
|
||||
RetenPolAllowedTables.AddAllowedTable(
|
||||
Database::"Contoso Activity Log", ContosoActivityLog.FieldNo(SystemCreatedAt));
|
||||
if not RetenPolAllowedTables.IsAllowedTable(Database::"Contoso Activity Log") then
|
||||
RetenPolAllowedTables.AddAllowedTable(
|
||||
Database::"Contoso Activity Log", ContosoActivityLog.FieldNo(SystemCreatedAt));
|
||||
end;
|
||||
}
|
||||
|
||||
codeunit 50571 "Contoso Reten. Pol. Install"
|
||||
{
|
||||
Subtype = Install;
|
||||
Access = Internal;
|
||||
|
||||
trigger OnInstallAppPerCompany()
|
||||
var
|
||||
ContosoRetenPolRegister: Codeunit "Contoso Reten. Pol. Register";
|
||||
begin
|
||||
ContosoRetenPolRegister.AddAllowedTables();
|
||||
end;
|
||||
}
|
||||
|
||||
codeunit 50572 "Contoso Reten. Pol. Upgrade"
|
||||
{
|
||||
Subtype = Upgrade;
|
||||
Access = Internal;
|
||||
|
||||
trigger OnUpgradePerCompany()
|
||||
var
|
||||
ContosoRetenPolRegister: Codeunit "Contoso Reten. Pol. Register";
|
||||
begin
|
||||
ContosoRetenPolRegister.AddAllowedTables();
|
||||
end;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue