Skip to content

Commit

Permalink
Fix for deleted records that are not exported. (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertverbeek4PS committed Apr 30, 2024
1 parent 374f649 commit 9aa2086
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions businessCentral/app/src/Execute.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,14 @@ codeunit 82561 "ADLSE Execute"
ADLSEExecution.Log('ADLSE-010', 'Deleted records found', Verbosity::Normal, CustomDimensions);
end;

repeat
ADLSEUtil.CreateFakeRecordForDeletedAction(ADLSEDeletedRecord, RecordRef);
if ADLSECommunication.TryCollectAndSendRecord(RecordRef, ADLSEDeletedRecord."Entry No.", FlushedTimeStamp) then
DeletedLastEntryNo := FlushedTimeStamp
else
Error('%1%2', GetLastErrorText(), GetLastErrorCallStack());
until ADLSEDeletedRecord.Next() = 0;
if ADLSEDeletedRecord.FindSet() then
repeat
ADLSEUtil.CreateFakeRecordForDeletedAction(ADLSEDeletedRecord, RecordRef);
if ADLSECommunication.TryCollectAndSendRecord(RecordRef, ADLSEDeletedRecord."Entry No.", FlushedTimeStamp) then
DeletedLastEntryNo := FlushedTimeStamp
else
Error('%1%2', GetLastErrorText(), GetLastErrorCallStack());
until ADLSEDeletedRecord.Next() = 0;

if ADLSECommunication.TryFinish(FlushedTimeStamp) then
DeletedLastEntryNo := FlushedTimeStamp
Expand All @@ -268,17 +269,18 @@ codeunit 82561 "ADLSE Execute"
RecordRef: RecordRef;
begin
//Because of the merge function of Contact, Vendor and customer
case ADLSEDeletedRecord."Table ID" of
18, 23, 5050:
begin
RecordRef.Open(ADLSEDeletedRecord."Table ID");
if ADLSEDeletedRecord.FindSet() then
repeat
if ADLSEDeletedRecord.FindSet() then
repeat
case ADLSEDeletedRecord."Table ID" of
18, 23, 5050:
begin
RecordRef.Open(ADLSEDeletedRecord."Table ID");
if RecordRef.GetBySystemId(ADLSEDeletedRecord."System ID") then
ADLSEDeletedRecord.Delete();
until ADLSEDeletedRecord.Next() = 0;
ADLSEDeletedRecord.Delete(false);
RecordRef.Close();
end;
end;
end;
until ADLSEDeletedRecord.Next() = 0;
end;

procedure CreateFieldListForTable(TableID: Integer) FieldIdList: List of [Integer]
Expand Down

0 comments on commit 9aa2086

Please sign in to comment.