@@ -8,6 +8,7 @@ namespace System.Tooling;
8
8
using System. PerformanceProfile;
9
9
using System. Security. AccessControl;
10
10
using System. DataAdministration;
11
+ using System. Security. User;
11
12
12
13
// / <summary>
13
14
// / Card page for schedule based sampling profilers
@@ -30,31 +31,47 @@ page 1932 "Perf. Profiler Schedule Card"
30
31
group ( General)
31
32
{
32
33
Caption = ' General' ;
33
- AboutText = ' General information about the profiler schedule.' ;
34
- AboutTitle = ' General information' ;
35
34
35
+ field ( Description; Rec. Description)
36
+ {
37
+ ApplicationArea = All;
38
+ Caption = ' Description' ;
39
+ ToolTip = ' Specifies the description of the schedule.' ;
40
+
41
+ trigger OnValidate()
42
+ begin
43
+ this. ValidateDescription() ;
44
+ end ;
45
+ }
36
46
field ( "Schedule ID"; Rec. "Schedule ID")
37
47
{
38
48
ApplicationArea = All;
39
49
Caption = ' Schedule ID' ;
40
50
ToolTip = ' Specifies the ID of the schedule.' ;
41
- AboutText = ' The ID of the schedule.' ;
42
51
Editable = false;
43
- Visible = false;
44
52
}
53
+ #if not CLEAN27
45
54
field ( Enabled; Rec. Enabled)
46
55
{
47
56
ApplicationArea = All;
48
57
Caption = ' Enabled' ;
49
58
ToolTip = ' Specifies whether the schedule is enabled.' ;
50
59
AboutText = ' Specifies whether the schedule is enabled.' ;
60
+ Visible = false;
61
+ ObsoleteReason = ' This field is moved to StatusGroup.' ;
62
+ ObsoleteState = Pending;
63
+ ObsoleteTag = ' 27.0' ;
51
64
}
52
65
field ( "Start Time"; Rec. "Starting Date-Time")
53
66
{
54
67
ApplicationArea = All;
55
68
Caption = ' Start Time' ;
56
69
ToolTip = ' Specifies the start time of the schedule.' ;
57
70
AboutText = ' The start time of the schedule.' ;
71
+ Visible = false;
72
+ ObsoleteReason = ' This field is moved to StatusGroup.' ;
73
+ ObsoleteState = Pending;
74
+ ObsoleteTag = ' 27.0' ;
58
75
59
76
trigger OnValidate()
60
77
begin
@@ -67,52 +84,125 @@ page 1932 "Perf. Profiler Schedule Card"
67
84
Caption = ' End Time' ;
68
85
ToolTip = ' Specifies the end time of the schedule.' ;
69
86
AboutText = ' The end time of the schedule.' ;
87
+ Visible = false;
88
+ ObsoleteReason = ' This field is moved to StatusGroup.' ;
89
+ ObsoleteState = Pending;
90
+ ObsoleteTag = ' 27.0' ;
70
91
71
92
trigger OnValidate()
72
93
begin
73
94
ScheduledPerfProfiler. ValidatePerformanceProfileSchedulerDatesRelation( Rec) ;
74
95
ScheduledPerfProfiler. ValidatePerformanceProfileEndTime( Rec) ;
75
96
end ;
76
97
}
77
- field ( Description; Rec. Description)
98
+ #endif
99
+ }
100
+ group ( StatusGroup)
101
+ {
102
+ Caption = ' Status' ;
103
+
104
+ field ( Status; Status)
78
105
{
79
106
ApplicationArea = All;
80
- Caption = ' Description' ;
81
- ToolTip = ' Specifies the description of the schedule.' ;
82
- AboutText = ' The description of the schedule.' ;
107
+ Caption = ' Status' ;
108
+ ToolTip = ' Specifies the status of the schedule.' ;
109
+ Editable = false;
110
+ }
111
+ field ( "Is Enabled"; Rec. Enabled)
112
+ {
113
+ ApplicationArea = All;
114
+ Caption = ' Enabled' ;
115
+ ToolTip = ' Specifies whether the schedule is enabled.' ;
83
116
84
117
trigger OnValidate()
85
118
begin
86
- this . ValidateDescription () ;
119
+ CurrPage . Update () ;
87
120
end ;
88
121
}
89
- }
122
+ field ( "Starting Date-Time"; Rec. "Starting Date-Time")
123
+ {
124
+ ApplicationArea = All;
125
+ Caption = ' Start Time' ;
126
+ ToolTip = ' Specifies the start time of the schedule.' ;
127
+
128
+ trigger OnValidate()
129
+ begin
130
+ if Rec. Enabled then
131
+ ScheduledPerfProfiler. ValidatePerformanceProfileSchedulerDatesRelation( Rec) ;
132
+ CurrPage. Update() ;
133
+ end ;
134
+ }
135
+ field ( "Ending Date-Time"; Rec. "Ending Date-Time")
136
+ {
137
+ ApplicationArea = All;
138
+ Caption = ' End Time' ;
139
+ ToolTip = ' Specifies the end time of the schedule.' ;
140
+ AboutText = ' The time at which the schedule will become automatically inactive.' ;
90
141
142
+ trigger OnValidate()
143
+ begin
144
+ if Rec. Enabled then
145
+ ScheduledPerfProfiler. ValidatePerformanceProfileSchedulerDatesRelation( Rec) ;
146
+ ScheduledPerfProfiler. ValidatePerformanceProfileEndTime( Rec) ;
147
+ CurrPage. Update() ;
148
+ end ;
149
+ }
150
+ }
91
151
group ( Filtering)
92
152
{
93
153
Caption = ' Filtering Criteria' ;
94
- AboutText = ' Filtering criteria for the profiler schedule .' ;
95
-
154
+ AboutText = ' Determines which activities will be profiled .' ;
155
+ #if not CLEAN27
96
156
field ( "User ID"; Rec. "User ID")
97
157
{
98
158
ApplicationArea = All;
99
159
Caption = ' User ID' ;
100
160
ToolTip = ' Specifies the ID of the user associated with the schedule.' ;
101
- AboutText = ' The ID of the user associated with the schedule.' ;
102
161
TableRelation = User. "User Security ID";
103
162
Lookup = true;
163
+ Visible = false;
164
+ ObsoleteReason = ' This field is obsolete. Use "User Name" instead.' ;
165
+ ObsoleteState = Pending;
166
+ ObsoleteTag = ' 27.0' ;
104
167
105
168
trigger OnValidate()
106
169
begin
107
170
ScheduledPerfProfiler. ValidateScheduleCreationPermissions( UserSecurityId() , Rec. "User ID") ;
108
171
end ;
109
172
}
173
+ #endif
174
+ field ( "User Name"; UserName)
175
+ {
176
+ ApplicationArea = All;
177
+ Caption = ' User Name' ;
178
+ ToolTip = ' Specifies the name of the user associated with the schedule.' ;
179
+ AboutText = ' Only this user'' s sessions will be profiled.' ;
180
+
181
+ trigger OnLookup( var Text : Text ) : Boolean
182
+ var
183
+ SelectedUser: Record User;
184
+ UserSelection: Codeunit "User Selection";
185
+ begin
186
+ UserSelection. Open( SelectedUser) ;
187
+ UserName := SelectedUser. "User Name";
188
+ Rec. Validate( "User ID", SelectedUser. "User Security ID") ;
189
+ end ;
190
+
191
+ trigger OnValidate()
192
+ var
193
+ User: Record User;
194
+ begin
195
+ User. SetRange( "User Name", UserName) ;
196
+ if User. FindFirst() then
197
+ ScheduledPerfProfiler. ValidateScheduleCreationPermissions( UserSecurityId() , User. "User Security ID") ;
198
+ end ;
199
+ }
110
200
field ( Activity; Activity)
111
201
{
112
202
ApplicationArea = All;
113
203
Caption = ' Activity Type' ;
114
204
ToolTip = ' Specifies the type of activity for which the schedule is created.' ;
115
- AboutText = ' The type of activity for which the schedule is created .' ;
205
+ AboutText = ' Only this type of session will be profiled .' ;
116
206
117
207
trigger OnValidate()
118
208
begin
@@ -123,21 +213,18 @@ page 1932 "Perf. Profiler Schedule Card"
123
213
group ( Advanced)
124
214
{
125
215
Caption = ' Advanced Settings' ;
126
- AboutText = ' Advanced settings for the profiler schedule.' ;
127
216
128
217
field ( Frequency; Rec. Frequency)
129
218
{
130
219
ApplicationArea = All;
131
220
Caption = ' Sampling Frequency' ;
132
221
ToolTip = ' Specifies the frequency at which the profiler will sample data.' ;
133
- AboutText = ' The frequency at which the profiler will sample data.' ;
134
222
}
135
223
field ( "Retention Policy"; RetentionPeriod)
136
224
{
137
225
ApplicationArea = All;
138
226
Caption = ' Retention Period' ;
139
227
ToolTip = ' Specifies the retention period of the profile.' ;
140
- AboutText = ' The retention period the profile will be kept.' ;
141
228
Editable = false;
142
229
143
230
trigger OnDrillDown()
@@ -159,7 +246,6 @@ page 1932 "Perf. Profiler Schedule Card"
159
246
ApplicationArea = All;
160
247
Caption = ' Activity Duration Threshold (ms)' ;
161
248
ToolTip = ' Specifies the minimum amount of time an activity must last in order to be recorded in a profile.' ;
162
- AboutText = ' Limit the amount of sampling profiles that are created by setting a millisecond threshold. Only activities that last longer then the threshold will be created.' ;
163
249
164
250
trigger OnValidate()
165
251
begin
@@ -211,6 +297,8 @@ page 1932 "Perf. Profiler Schedule Card"
211
297
ScheduledPerfProfiler. MapActivityTypeToRecord( Rec, Activity) ;
212
298
RetentionPeriod := ScheduledPerfProfiler. GetRetentionPeriod() ;
213
299
ProfileCreationThreshold := Rec. "Profile Creation Threshold";
300
+ Status := ScheduledPerfProfilerImpl. GetStatus( Rec) ;
301
+ UserName := ScheduledPerfProfiler. MapRecordToUserName( Rec) ;
214
302
end ;
215
303
216
304
trigger OnModifyRecord() : Boolean
@@ -227,17 +315,21 @@ page 1932 "Perf. Profiler Schedule Card"
227
315
228
316
var
229
317
ScheduledPerfProfiler: Codeunit "Scheduled Perf. Profiler";
318
+ ScheduledPerfProfilerImpl: Codeunit "Scheduled Perf. Profiler Impl.";
230
319
Activity: Enum "Perf. Profile Activity Type";
231
320
ProfileCreationThreshold: BigInteger ;
232
321
RetentionPeriod: Code [20 ];
322
+ Status: Text ;
323
+ UserName: Text ;
233
324
MaxRetentionPeriod: Duration ;
234
325
NoRetentionPolicySetupErr: Label ' No retention policy setup found for the performance profiles table.' ;
235
326
CreateRetentionPolicySetupTxt: Label ' Create a retention policy setup' ;
236
327
EmptyDescriptionErr: Label ' The description must be filled in.' ;
237
328
238
329
local procedure ValidateRecord()
239
330
begin
240
- ScheduledPerfProfiler. ValidatePerformanceProfileSchedulerDates( Rec, MaxRetentionPeriod) ;
331
+ if Rec. Enabled then
332
+ ScheduledPerfProfiler. ValidatePerformanceProfileSchedulerDates( Rec, MaxRetentionPeriod) ;
241
333
ScheduledPerfProfiler. ValidatePerformanceProfileSchedulerRecord( Rec, Activity) ;
242
334
end ;
243
335
0 commit comments