-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomerCard.PageExt
44 lines (41 loc) · 1.19 KB
/
CustomerCard.PageExt
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
pageextension 50044 "SerCustomerCard.PageExt" extends "Customer Card"
{
layout
{
addlast("Address & Contact")
{
group("Yandex Map")
{
usercontrol(YMaps; YMaps)
{
ApplicationArea = All;
trigger OnReady()
begin
GetAddr();
end;
}
}
}
}
local procedure GetAddr()
var
CustData: JsonObject;
CountryRec: Record "Country/Region";
addr: Text;
begin
if StrLen(Rec.Address) > 0 then
addr := Rec.Address;
if StrLen(Rec."Address 2") > 0 then
addr := addr + ' ' + Rec."Address 2";
if StrLen(Rec.City) > 0 then
addr := addr + ' ' + Rec.City;
/* if StrLen(Rec."Post Code") > 0 then
addr := addr + ' ' + Rec."Post Code"; */
CountryRec.Reset();
CountryRec.SetRange(Code, Rec."Country/Region Code");
if CountryRec.FindFirst() then
addr := addr + ',' + CountryRec.Name;
CustData.Add('addr', addr);
CurrPage.YMaps.GetAddr(CustData);
end;
}