/
RegisterAndPlayVideo.al
59 lines (57 loc) · 1.94 KB
/
RegisterAndPlayVideo.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
codeunit 50118 RegisterNewVideos
{
[EventSubscriber(ObjectType::Codeunit, Codeunit::Video, OnRegisterVideo, '', false, false)]
local procedure OnRegisterVideo(var Sender: Codeunit Video);
begin
Sender.Register('801277c3-645a-4471-a40b-d6cfdad7112e', 'What''s new: Business Central developer tools (2023 release wave 2)', 'https://www.youtube.com/embed/TY82NR2hGEg', Enum::"Video Category"::Customize);
Sender.Register('801277c3-645a-4471-a40b-d6cfdad7112e', 'Get low friction go lives and optimize your investments with telemetry data', 'https://www.youtube.com/embed/F_pssS0FtUc', Enum::"Video Category"::ReadyForBusiness);
Sender.Register('801277c3-645a-4471-a40b-d6cfdad7112e', 'Introducing: Analyze data on lists and queries', 'https://www.youtube.com/embed/qmLVKyHRhNc', Enum::"Video Category"::ReadyForBusiness);
end;
}
tableextension 50115 ItemExt extends Item
{
fields
{
field(50000; VideoURL; Text[100])
{
Caption = 'Video URL';
Description = 'Embed video';
DataClassification = CustomerContent;
}
}
}
pageextension 50115 ItemCardExt extends "Item Card"
{
layout
{
addafter("Purchasing Code")
{
field(VideoURL; Rec.VideoURL)
{
ApplicationArea = All;
ToolTip = 'Specifies the Video Url, such as youtube.';
}
}
}
actions
{
addlast(processing)
{
action(PlayVideo)
{
Caption = 'Play Video';
Promoted = true;
PromotedCategory = Process;
PromotedIsBig = true;
ApplicationArea = All;
image = Picture;
trigger OnAction()
var
VideoCod: Codeunit Video;
begin
VideoCod.Play(Rec.VideoURL);
end;
}
}
}
}