Skip to content

Commit

Permalink
Fix bug on XML import and added a confirm option. (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertverbeek4PS committed Mar 27, 2024
2 parents 4d7372c + 11efd5b commit 2215536
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion businessCentral/app/src/BC2ADLSImport.xmlport.al
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}

0 comments on commit 2215536

Please sign in to comment.