Skip to content

Commit

Permalink
Fix dead lock adls table on reset (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertverbeek4PS committed Apr 10, 2024
2 parents 2215536 + 2d7c46d commit f33e983
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
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

0 comments on commit f33e983

Please sign in to comment.