From 82ecee115bec4adf0f94e6c935ad5cc4f043075b Mon Sep 17 00:00:00 2001 From: RonThree60 Date: Wed, 16 Aug 2023 19:40:45 +0200 Subject: [PATCH 1/2] Adding bound action to Table Api page to automaticaly add all fields --- businessCentral/app.json | 2 +- businessCentral/src/ADLSETable.Table.al | 16 ++++++++++++++++ businessCentral/src/ADLSETableAPI.Page.al | 12 ++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/businessCentral/app.json b/businessCentral/app.json index 2957fe4..64b4a1f 100644 --- a/businessCentral/app.json +++ b/businessCentral/app.json @@ -4,7 +4,7 @@ "publisher": "The bc2adls team, Microsoft Denmark", "brief": "Sync data from Business Central to the Azure storage", "description": "Exports data in chosen tables to the Azure Data Lake and keeps it in sync by incremental updates. Before you use this tool, please read the SUPPORT.md file at https://github.com/microsoft/bc2adls.", - "version": "1.3.14.0", + "version": "1.3.16.0", "privacyStatement": "https://go.microsoft.com/fwlink/?LinkId=724009", "EULA": "https://go.microsoft.com/fwlink/?linkid=2009120", "help": "https://go.microsoft.com/fwlink/?LinkId=724011", diff --git a/businessCentral/src/ADLSETable.Table.al b/businessCentral/src/ADLSETable.Table.al index 26dd5dc..7a57923 100644 --- a/businessCentral/src/ADLSETable.Table.al +++ b/businessCentral/src/ADLSETable.Table.al @@ -215,4 +215,20 @@ table 82561 "ADLSE Table" Verbosity::Warning, CustomDimensions); end; end; + + procedure AddAllFields() + var + ADLSEFields: Record "ADLSE Field"; + begin + ADLSEFields.InsertForTable(Rec); + ADLSEFields.SetRange("Table ID", Rec."Table ID"); + if ADLSEFields.FindSet() then + repeat + if (ADLSEFields.CanFieldBeEnabled()) then begin + ADLSEFields.Enabled := true; + ADLSEFields.Modify(); + end; + until ADLSEFields.Next() = 0; + end; + } \ No newline at end of file diff --git a/businessCentral/src/ADLSETableAPI.Page.al b/businessCentral/src/ADLSETableAPI.Page.al index 1af47e4..b39c043 100644 --- a/businessCentral/src/ADLSETableAPI.Page.al +++ b/businessCentral/src/ADLSETableAPI.Page.al @@ -81,6 +81,18 @@ page 82565 "ADLSE Table API" until SelectedADLSETable.Next() = 0; SetActionResponse(ActionContext, Rec.SystemId); end; + [ServiceEnabled] + procedure AddAllFields(var ActionContext: WebServiceActionContext) + var + SelectedADLSETable: Record "ADLSE Table"; + begin + CurrPage.SetSelectionFilter(SelectedADLSETable); + if SelectedADLSETable.FindSet(true) then + repeat + SelectedADLSETable.AddAllFields(); + until SelectedADLSETable.Next() = 0; + SetActionResponse(ActionContext, Rec.SystemId); + end; local procedure SetActionResponse(var ActionContext: WebServiceActionContext; AdlsId: Guid) var From 00905054cbb9fe75ca42092bc1ab11a0c6cd5ed2 Mon Sep 17 00:00:00 2001 From: Ron Koppelaar Date: Thu, 17 Aug 2023 20:04:19 +0200 Subject: [PATCH 2/2] Fixed proposed solution --- businessCentral/src/ADLSETableAPI.Page.al | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/businessCentral/src/ADLSETableAPI.Page.al b/businessCentral/src/ADLSETableAPI.Page.al index b39c043..31dd3da 100644 --- a/businessCentral/src/ADLSETableAPI.Page.al +++ b/businessCentral/src/ADLSETableAPI.Page.al @@ -81,16 +81,11 @@ page 82565 "ADLSE Table API" until SelectedADLSETable.Next() = 0; SetActionResponse(ActionContext, Rec.SystemId); end; + [ServiceEnabled] procedure AddAllFields(var ActionContext: WebServiceActionContext) - var - SelectedADLSETable: Record "ADLSE Table"; begin - CurrPage.SetSelectionFilter(SelectedADLSETable); - if SelectedADLSETable.FindSet(true) then - repeat - SelectedADLSETable.AddAllFields(); - until SelectedADLSETable.Next() = 0; + rec.AddAllFields(); SetActionResponse(ActionContext, Rec.SystemId); end;