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 dead lock adls table on reset #111

Merged
merged 2 commits into from
Apr 10, 2024
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
1 change: 1 addition & 0 deletions businessCentral/app/src/Setup.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ codeunit 82560 "ADLSE Setup"
AllObjectsWithCaption: Page "All Objects with Caption";
begin
AllObjWithCaption.SetRange("Object Type", AllObjWithCaption."Object Type"::Table);
AllObjWithCaption.SetFilter("Object ID", '<>%1', Database::"ADLSE Deleted Record");

AllObjectsWithCaption.Caption(SelectTableLbl);
AllObjectsWithCaption.SetTableView(AllObjWithCaption);
Expand Down
11 changes: 9 additions & 2 deletions businessCentral/app/src/Table.Table.al
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ table 82561 "ADLSE Table"
trigger OnValidate()
var
ADLSEExternalEvents: Codeunit "ADLSE External Events";
ADLSETableErr: Label 'The ADLSE Table table cannot be disabled.';
begin
if Rec."Table ID" = Database::"ADLSE Table" then
if xRec.Enabled = false then
Error(ADLSETableErr);

if Rec.Enabled then
CheckExportingOnlyValidFields();

Expand Down Expand Up @@ -176,8 +181,10 @@ table 82561 "ADLSE Table"
begin
if Rec.FindSet(true) then
repeat
Rec.Enabled := true;
Rec.Modify();
if not Rec.Enabled then begin
Rec.Enabled := true;
Rec.Modify();
end;

ADLSETableLastTimestamp.SaveUpdatedLastTimestamp(Rec."Table ID", 0);
ADLSETableLastTimestamp.SaveDeletedLastEntryNo(Rec."Table ID", 0);
Expand Down
Loading