-
Notifications
You must be signed in to change notification settings - Fork 4
/
DEVKillSession.Page.al
109 lines (102 loc) · 3.42 KB
/
DEVKillSession.Page.al
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
page 83262 "DEV Kill Session"
{
Caption = 'Kill Sessions';
PageType = List;
UsageCategory = Lists;
ApplicationArea = All;
SourceTable = "Active Session";
Editable = false;
layout
{
area(Content)
{
repeater(Group)
{
field("User ID"; "User ID")
{
ApplicationArea = All;
StyleExpr = StyleExp;
ToolTip = 'Specifies the value of the User ID field';
}
field("Session ID"; "Session ID")
{
ApplicationArea = All;
StyleExpr = StyleExp;
ToolTip = 'Specifies the value of the Session ID field';
}
field("Login Datetime"; "Login Datetime")
{
ApplicationArea = All;
StyleExpr = StyleExp;
ToolTip = 'Specifies the value of the Login Datetime field';
}
field("Client Type"; "Client Type")
{
ApplicationArea = All;
StyleExpr = StyleExp;
ToolTip = 'Specifies the value of the Client Type field';
}
field("Client Computer Name"; "Client Computer Name")
{
ApplicationArea = All;
StyleExpr = StyleExp;
ToolTip = 'Specifies the value of the Client Computer Name field';
}
field("Server Instance ID"; "Server Instance ID")
{
ApplicationArea = All;
StyleExpr = StyleExp;
ToolTip = 'Specifies the value of the Server Instance ID field';
}
field("Server Instance Name"; "Server Instance Name")
{
ApplicationArea = All;
StyleExpr = StyleExp;
ToolTip = 'Specifies the value of the Server Instance Name field';
}
field("Database Name"; "Database Name")
{
ApplicationArea = All;
StyleExpr = StyleExp;
ToolTip = 'Specifies the value of the Database Name field';
}
}
}
}
actions
{
area(Processing)
{
action(Kill)
{
Image = Stop;
Caption = 'Kill Session';
ApplicationArea = All;
Promoted = true;
PromotedCategory = Process;
PromotedIsBig = true;
PromotedOnly = true;
ToolTip = 'Kill selected session';
trigger OnAction();
var
KillMsg: Text;
begin
if "Session ID" = SessionId() then
exit;
KillMsg := StrSubstNo('%1 killed your current session.', "User ID");
ClearLastError();
if not StopSession("Session ID", KillMsg) then
Error(GetLastErrorText);
end;
}
}
}
trigger OnAfterGetRecord()
begin
StyleExp := 'standard';
if "Session ID" = SessionId() then
StyleExp := 'strong';
end;
var
StyleExp: Text;
}