This repository has been archived by the owner on Sep 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 52
/
ADLSETableAPI.Page.al
99 lines (93 loc) · 3.13 KB
/
ADLSETableAPI.Page.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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License. See LICENSE in the project root for license information.
page 82565 "ADLSE Table API"
{
PageType = API;
APIPublisher = 'bc2adlsTeamMicrosoft';
APIGroup = 'bc2adls';
APIVersion = 'v1.0';
EntityName = 'adlseTable';
EntitySetName = 'adlseTables';
SourceTable = "ADLSE Table";
InsertAllowed = true;
ModifyAllowed = false;
DeleteAllowed = false;
DelayedInsert = true;
ODataKeyFields = SystemId;
layout
{
area(Content)
{
repeater(GroupName)
{
field(tableId; Rec."Table ID") { }
field(enabled; Rec.Enabled)
{
Editable = false;
}
field(systemId; Rec.SystemId)
{
Editable = false;
}
field(systemRowVersion; Rec.SystemRowVersion)
{
Editable = false;
}
}
part(adlseField; "ADLSE Field API")
{
EntityName = 'adlseField';
EntitySetName = 'adlseFields';
SubPageLink = "Table ID" = Field("Table ID");
}
}
}
[ServiceEnabled]
procedure Reset(var ActionContext: WebServiceActionContext)
var
SelectedADLSETable: Record "ADLSE Table";
begin
CurrPage.SetSelectionFilter(SelectedADLSETable);
SelectedADLSETable.ResetSelected();
SetActionResponse(ActionContext, Rec.SystemId);
end;
[ServiceEnabled]
procedure Enable(var ActionContext: WebServiceActionContext)
var
SelectedADLSETable: Record "ADLSE Table";
begin
CurrPage.SetSelectionFilter(SelectedADLSETable);
if SelectedADLSETable.FindSet(true) then
repeat
SelectedADLSETable.Validate(Enabled, true);
SelectedADLSETable.Modify(true);
until SelectedADLSETable.Next() = 0;
SetActionResponse(ActionContext, Rec.SystemId);
end;
[ServiceEnabled]
procedure Disable(var ActionContext: WebServiceActionContext)
var
SelectedADLSETable: Record "ADLSE Table";
begin
CurrPage.SetSelectionFilter(SelectedADLSETable);
if SelectedADLSETable.FindSet(true) then
repeat
SelectedADLSETable.Validate(Enabled, false);
SelectedADLSETable.Modify(true);
until SelectedADLSETable.Next() = 0;
SetActionResponse(ActionContext, Rec.SystemId);
end;
local procedure SetActionResponse(var ActionContext: WebServiceActionContext; AdlsId: Guid)
var
begin
SetActionResponse(ActionContext, Page::"ADLSE Table API", AdlsId);
end;
local procedure SetActionResponse(var ActionContext: WebServiceActionContext; PageId: Integer; DocumentId: Guid)
var
begin
ActionContext.SetObjectType(ObjectType::Page);
ActionContext.SetObjectId(PageId);
ActionContext.AddEntityKey(Rec.FieldNo(SystemId), DocumentId);
ActionContext.SetResultCode(WebServiceActionResultCode::Updated);
end;
}