Debian Codegraph @

examples/prism-al.html

raw symbols SCIP
1 <h2>Full example</h2>
2 <pre><code>// Source: https://github.com/microsoft/AL/blob/master/samples/ControlAddIn/al/Page/CustomerCardAddIn.al
3
4 pageextension 50300 CustomerCardAddIn extends "Customer Card"
5 {
6 layout
7 {
8 addafter(Blocked)
9 {
10 usercontrol(ControlName; TestAddIn)
11 {
12 ApplicationArea = All;
13
14 trigger Callback(i : integer; s: text; d : decimal; c : char)
15 begin
16 Message('Got from js: %1, %2, %3, %4', i, s, d, c);
17 end;
18 }
19 }
20 }
21
22 actions
23 {
24 addafter(Approve)
25 {
26 action(CallJavaScript)
27 {
28 ApplicationArea = All;
29
30 trigger OnAction();
31 begin
32 CurrPage.ControlName.CallJavaScript(5, 'text', 6.3, 'c');
33 end;
34 }
35
36 action(CallViaCodeunit)
37 {
38 ApplicationArea = All;
39
40 trigger OnAction();
41 var c : Codeunit AddInHelpers;
42 begin
43 c.CallJavaScript(CurrPage.ControlName);
44 end;
45 }
46
47 action(CallStaleControlAddIn)
48 {
49 ApplicationArea = All;
50
51 trigger OnAction();
52 var c : Codeunit AddInHelpersSingleton;
53 begin
54 c.CallStaleAddInMethod();
55 Message('Probably nothing should happen...');
56 end;
57 }
58 }
59 }
60 }</code></pre>