/
BuildingRecommendedApps.al
138 lines (128 loc) · 3.85 KB
/
BuildingRecommendedApps.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
pageextension 50115 RecommendedAppsListExt extends "Recommended Apps List"
{
actions
{
addfirst(Processing)
{
action(AddRecommendedApps)
{
Caption = 'Add Recommended Apps';
ApplicationArea = All;
Promoted = true;
PromotedIsBig = true;
PromotedCategory = Process;
Image = Add;
trigger OnAction()
var
AddRecommendedApp: Page "ZY Add Recommended App";
begin
if AddRecommendedApp.RunModal() = Action::OK then
AddRecommendedApp.InsertRecommendedApp();
end;
}
action(DeleteRecommendedApps)
{
Caption = 'Delete Selected Recommended Apps';
ApplicationArea = All;
Promoted = true;
PromotedIsBig = true;
PromotedCategory = Process;
Image = Delete;
trigger OnAction()
var
RecommendedApps: Codeunit "Recommended Apps";
begin
CurrPage.SetSelectionFilter(Rec);
if RecommendedApps.DeleteApp(Rec.Id) then
Message('Recommended App is deleted!!!');
end;
}
}
}
}
page 50116 "ZY Add Recommended App"
{
Caption = 'Add Recommended App';
PageType = StandardDialog;
layout
{
area(Content)
{
field(AppId; AppId)
{
Caption = 'App Id';
ApplicationArea = All;
}
field(SortingId; SortingId)
{
Caption = 'Sourting Id';
ApplicationArea = All;
}
field(Name; Name)
{
Caption = 'Name';
ApplicationArea = All;
}
field(Publisher; Publisher)
{
Caption = 'Publisher';
ApplicationArea = All;
}
field(ShortDescription; ShortDescription)
{
Caption = 'Short Description';
ApplicationArea = All;
}
field(LongDescription; LongDescription)
{
Caption = 'Long Description';
ApplicationArea = All;
MultiLine = true;
}
field(AppSourceURL; AppSourceURL)
{
Caption = 'AppSource URL';
ApplicationArea = All;
}
}
}
var
AppId: Guid;
SortingId: Integer;
Name: Text[250];
Publisher: Text[250];
ShortDescription: Text[250];
LongDescription: Text[2480];
AppSourceURL: Text;
procedure InsertRecommendedApp()
var
RecommendedApps: Codeunit "Recommended Apps";
RecommendedBy: Enum "App Recommended By";
begin
if RecommendedApps.InsertApp(AppId, SortingId, Name, Publisher, ShortDescription, LongDescription, RecommendedBy::"Your Microsoft Reseller", AppSourceURL) then
Message('Recommended App is added!!!')
else
Error('Something is wrong!!!');
end;
}
pageextension 50116 RecommendedAppCardExt extends "Recommended App Card"
{
actions
{
addfirst(Processing)
{
action(InstallAppSourceExtension)
{
Caption = 'Install AppSource Extension';
ApplicationArea = All;
Image = Installments;
trigger OnAction()
var
ExtManagement: Codeunit "Extension Management";
begin
ExtManagement.DeployExtension(Rec.Id, 1041, true);
end;
}
}
}
}