Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug on XML import and added a confirm option. #109

Merged
merged 1 commit into from
Mar 27, 2024
Merged
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
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;
}
Loading