diff --git a/businessCentral/app.json b/businessCentral/app.json index e0213de..82e30a7 100644 --- a/businessCentral/app.json +++ b/businessCentral/app.json @@ -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" +} \ No newline at end of file diff --git a/businessCentral/src/ADLSEField.Table.al b/businessCentral/src/ADLSEField.Table.al index badc424..c2e38ea 100644 --- a/businessCentral/src/ADLSEField.Table.al +++ b/businessCentral/src/ADLSEField.Table.al @@ -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]) @@ -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; } \ No newline at end of file diff --git a/businessCentral/src/ADLSESetupFields.Page.al b/businessCentral/src/ADLSESetupFields.Page.al index 39e9bb0..f5f214c 100644 --- a/businessCentral/src/ADLSESetupFields.Page.al +++ b/businessCentral/src/ADLSESetupFields.Page.al @@ -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; + } } } @@ -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.'; } \ No newline at end of file