diff --git a/businessCentral/app/src/BC2ADLSImport.xmlport.al b/businessCentral/app/src/BC2ADLSImport.xmlport.al index c633a2e..9207dd3 100644 --- a/businessCentral/app/src/BC2ADLSImport.xmlport.al +++ b/businessCentral/app/src/BC2ADLSImport.xmlport.al @@ -51,7 +51,8 @@ xmlport 82560 "BC2ADLS Import" ADLSETableRec.Validate("Table ID", ADLSEField."Table ID"); ADLSETableRec.Enabled := true; ADLSETableRec.Insert(true); - ADLSETable.AddAllFields(); + ADLSEFieldRec.SetRange("Table ID", ADLSEField."Table ID"); + ADLSEFieldRec.InsertForTable(ADLSETableRec); end; if ADLSEFieldRec.Get(ADLSEField."Table ID", ADLSEField."Field ID") then begin @@ -69,4 +70,21 @@ xmlport 82560 "BC2ADLS Import" } } } + + trigger OnPreXmlPort() + var + ADLSETableRec: Record "ADLSE Table"; + ConfirmManagement: Codeunit "Confirm Management"; + ConfirmQuestionMsg: Label 'With the import all existing ADLSE Tables and Fields will be deleted. Do you want to continue?'; + begin + if not ADLSETableRec.IsEmpty then + if GuiAllowed then begin + if ConfirmManagement.GetResponse(ConfirmQuestionMsg, true) then + ADLSETableRec.DeleteAll(true) + else + currXMLport.Quit(); + end else + ADLSETableRec.DeleteAll(true); + + end; } \ No newline at end of file