@@ -31,7 +31,6 @@ codeunit 1596 "Email Installer"
31
31
procedure AddRetentionPolicyAllowedTables()
32
32
begin
33
33
AddRetentionPolicyAllowedTables( false) ;
34
- CreateRetentionPolicySetup( false) ;
35
34
end ;
36
35
37
36
procedure AddRetentionPolicyAllowedTables( ForceUpdate: Boolean )
@@ -47,59 +46,21 @@ codeunit 1596 "Email Installer"
47
46
48
47
RetenPolAllowedTables. AddAllowedTable( Database ::"Email Outbox", Field . FieldNo( SystemCreatedAt) , 7 ) ;
49
48
RetenPolAllowedTables. AddAllowedTable( Database ::"Sent Email", Field . FieldNo( SystemCreatedAt) , 7 ) ;
49
+ RetenPolAllowedTables. AddAllowedTable( Database ::"Email Inbox", Field . FieldNo( SystemCreatedAt) , 2 ) ;
50
50
51
51
if IsInitialSetup then
52
52
UpgradeTag. SetUpgradeTag( GetEmailTablesAddedToAllowedListUpgradeTag()) ;
53
53
end ;
54
54
55
- procedure CreateRetentionPolicySetup( ForceUpdate: Boolean )
56
- var
57
- Field : Record Field ;
58
- RetentionPolicySetup: Record "Retention Policy Setup";
59
- RetenPolAllowedTables: Codeunit "Reten. Pol. Allowed Tables";
60
- RetentionPolicySetupCU: Codeunit "Retention Policy Setup";
61
- UpgradeTag: Codeunit "Upgrade Tag";
62
- DateFormula : DateFormula ;
63
- IsInitialSetup: Boolean ;
64
- begin
65
- IsInitialSetup := not UpgradeTag. HasUpgradeTag( GetEmailInboxPolicyAddedToAllowedListUpgradeTag()) ;
66
- if not ( IsInitialSetup or ForceUpdate) then
67
- exit ;
68
-
69
- if not RetenPolAllowedTables. AddAllowedTable( Database ::"Email Inbox", Field . FieldNo( SystemCreatedAt) , 2 ) then
70
- exit ;
71
-
72
- RetentionPolicySetup. SetRange( "Table Id", Database ::"Email Inbox") ;
73
- if not RetentionPolicySetup. IsEmpty() then
74
- exit ;
75
-
76
- Evaluate( DateFormula , ' <-2D>' ) ;
77
-
78
- RetentionPolicySetup. Validate( "Table Id", Database ::"Email Inbox") ;
79
- RetentionPolicySetup. Validate( "Apply to all records", true) ;
80
- RetentionPolicySetup. Validate( "Retention Period", RetentionPolicySetupCU. FindOrCreateRetentionPeriod( ' 2 DAYS' , "Retention Period Enum"::"Custom", DateFormula )) ;
81
- RetentionPolicySetup. Validate( Enabled, true) ;
82
- RetentionPolicySetup. Insert( true) ;
83
-
84
- if IsInitialSetup then
85
- UpgradeTag. SetUpgradeTag( GetEmailInboxPolicyAddedToAllowedListUpgradeTag()) ;
86
- end ;
87
-
88
55
local procedure GetEmailTablesAddedToAllowedListUpgradeTag() : Code [250 ]
89
56
begin
90
57
exit ( ' MS-373161-EmailLogEntryAdded-20201005' ) ;
91
58
end ;
92
59
93
- local procedure GetEmailInboxPolicyAddedToAllowedListUpgradeTag() : Code [250 ]
94
- begin
95
- exit ( ' MS-539754-EmailInboxPolicyAdded-20240827' ) ;
96
- end ;
97
-
98
60
[EventSubscriber( ObjectType ::Codeunit , Codeunit ::"Reten. Pol. Allowed Tables", OnRefreshAllowedTables, ' ' , false, false) ]
99
61
local procedure AddAllowedTablesOnRefreshAllowedTables()
100
62
begin
101
63
AddRetentionPolicyAllowedTables( true) ;
102
- CreateRetentionPolicySetup( true) ;
103
64
end ;
104
65
105
66
[EventSubscriber( ObjectType ::Codeunit , Codeunit ::"System Initialization", OnAfterLogin, ' ' , false, false) ]
0 commit comments