Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

Added select all to field page #14

Merged
merged 4 commits into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions businessCentral/app.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"id": "1688530c-452c-4b06-8947-ab4bf5b26053",
"name": "Azure Data Lake Storage Export",
"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.0.0.5",
"privacyStatement": "https://go.microsoft.com/fwlink/?LinkId=724009",
"EULA": "https://go.microsoft.com/fwlink/?linkid=2009120",
"help": "https://go.microsoft.com/fwlink/?LinkId=724011",
"url": "https://go.microsoft.com/fwlink/?LinkId=724011",
"contextSensitiveHelpUrl": "https://docs.microsoft.com/dynamics365/business-central/",
"dependencies": [
{"id": "63ca2fa4-4f03-4f2b-a480-172fef340d3f", "name": "System Application", "publisher": "Microsoft", "version": "18.0.0.0"},
{"id": "437dbf0e-84ff-417a-965d-ed2bb9650972", "name": "Base Application", "publisher": "Microsoft", "version": "18.0.0.0"}
],
"screenshots": [
"id": "1688530c-452c-4b06-8947-ab4bf5b26053",
"name": "Azure Data Lake Storage Export",
"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.0.0.5",
"privacyStatement": "https://go.microsoft.com/fwlink/?LinkId=724009",
"EULA": "https://go.microsoft.com/fwlink/?linkid=2009120",
"help": "https://go.microsoft.com/fwlink/?LinkId=724011",
"url": "https://go.microsoft.com/fwlink/?LinkId=724011",
"contextSensitiveHelpUrl": "https://docs.microsoft.com/dynamics365/business-central/",
"dependencies": [
{"id": "63ca2fa4-4f03-4f2b-a480-172fef340d3f", "name": "System Application", "publisher": "Microsoft", "version": "18.0.0.0"},
{"id": "437dbf0e-84ff-417a-965d-ed2bb9650972", "name": "Base Application", "publisher": "Microsoft", "version": "18.0.0.0"}
],
"screenshots": [

],
"platform": "18.0.0.0",
"showMyCode": true,
"idRanges": [
{
"from": 82560,
"to": 82569
}
],
"target": "Cloud",
"runtime": "7.2"
}
],
"platform": "18.0.0.0",
"showMyCode": true,
"idRanges": [
{
"from": 82560,
"to": 82569
}
],
"target": "Cloud",
"runtime": "7.2"
}
26 changes: 17 additions & 9 deletions businessCentral/src/ADLSEField.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,8 @@ table 82562 "ADLSE Field"
Caption = 'Enabled';

trigger OnValidate()
var
Fld: Record Field;
ADLSESetup: Codeunit "ADLSE Setup";
ADLSEUtil: Codeunit "ADLSE Util";
begin
Fld.Get(Rec."Table ID", Rec."Field ID");
if Enabled then begin
ADLSEUtil.CheckFieldTypeForExport(Fld);
ADLSESetup.CheckFieldClassCanBeExported(Fld);
end;
Rec.CheckFieldToBeEnabled();
end;
}
field(100; FieldCaption; Text[80])
Expand Down Expand Up @@ -82,4 +74,20 @@ table 82562 "ADLSE Field"
until Fld.Next() = 0;
end;

procedure CheckFieldToBeEnabled()
var
Fld: Record Field;
ADLSESetup: Codeunit "ADLSE Setup";
ADLSEUtil: Codeunit "ADLSE Util";
begin
Fld.Get(Rec."Table ID", Rec."Field ID");
ADLSEUtil.CheckFieldTypeForExport(Fld);
ADLSESetup.CheckFieldClassCanBeExported(Fld);
end;

[TryFunction]
procedure CanFieldBeEnabled()
begin
CheckFieldToBeEnabled();
end;
}
26 changes: 26 additions & 0 deletions businessCentral/src/ADLSESetupFields.Page.al
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,31 @@ page 82562 "ADLSE Setup Fields"
{
area(Processing)
{
action(SelectAll)
{
Caption = 'Enable all valid fields';
ApplicationArea = All;
ToolTip = 'Enables all fields of the table that can be enabled.';
Image = Apply;

trigger OnAction()
var
SomeFieldsCouldNotBeEnabled: Boolean;
begin
Rec.SetFilter(Enabled, '<>%1', true);
if Rec.FindSet() then
repeat
if Rec.CanFieldBeEnabled() then begin
Rec.Validate(Enabled, true);
Rec.Modify(true);
end else
SomeFieldsCouldNotBeEnabled := true;
until Rec.Next() = 0;
Rec.SetRange(Enabled);
if SomeFieldsCouldNotBeEnabled then
Message(SomeFieldsCouldNotBeEnabledMsg);
end;
}
}
}

Expand All @@ -88,5 +113,6 @@ page 82562 "ADLSE Setup Fields"
ADLSFieldName: Text;
FieldClassName: Option Normal,FlowField,FlowFilter;
FieldTypeName: Text[30];
SomeFieldsCouldNotBeEnabledMsg: Label 'One or more fields could not be enabled.';

}