-
Notifications
You must be signed in to change notification settings - Fork 0
/
TwoStrings.al
60 lines (57 loc) · 1.76 KB
/
TwoStrings.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
page 50200 "Get Longest Common Substring"
{
PageType = Card;
ApplicationArea = All;
UsageCategory = Administration;
layout
{
area(Content)
{
group(Input)
{
field(FirstString; FirstString)
{
Caption = 'First String';
ApplicationArea = All;
trigger OnValidate()
begin
if FirstString = '' then
LongestCommonSubstring := '';
GetLongestCommonSubstring();
end;
}
field(SecondString; SecondString)
{
Caption = 'Second String';
ApplicationArea = All;
trigger OnValidate()
begin
if SecondString = '' then
LongestCommonSubstring := '';
GetLongestCommonSubstring();
end;
}
}
group(Result)
{
field(LongestCommonSubstring; LongestCommonSubstring)
{
Caption = 'Longest Common Substring';
ApplicationArea = All;
Editable = false;
}
}
}
}
var
FirstString: Text;
SecondString: Text;
LongestCommonSubstring: Text;
local procedure GetLongestCommonSubstring()
var
RecordMatchMgt: Codeunit "Record Match Mgt.";
begin
if (FirstString <> '') and (SecondString <> '') then
LongestCommonSubstring := RecordMatchMgt.GetLongestCommonSubstring(FirstString, SecondString);
end;
}