diff --git a/src/Layers/APAC/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al b/src/Layers/APAC/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al index 5f2442a874..49ee5baf52 100644 --- a/src/Layers/APAC/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al +++ b/src/Layers/APAC/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al @@ -1363,8 +1363,12 @@ table 254 "VAT Entry" VATEntryLocal.Copy(Rec); VATEntryLocal.SetRange("G/L Acc. No.", ''); if WithUI then begin - if ShowConfirm then - Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + if GuiAllowed() then begin + if ShowConfirm and not Response then + Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + end else + // Background execution has no user to confirm with; proceed so the report can run unattended. + Response := true; if not Response then exit; @@ -1514,6 +1518,9 @@ table 254 "VAT Entry" VATEntryUpdate.SetRange("G/L Acc. No.", ''); VATEntryUpdate.SetFilter("Entry No.", EntryNoFilter.ToText()); VATEntryUpdate.ModifyAll("G/L Acc. No.", GLAccountNo, false); + // Persist each batch so a long-running adjustment that times out can resume from where it + // left off instead of restarting from scratch and never completing. + Commit(); EntryNoFilter.Clear(); TotalChunkDuration += CurrentDateTime() - StartTime; ChunkCount += 1; diff --git a/src/Layers/BE/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al b/src/Layers/BE/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al index 260c881193..c35aff10d9 100644 --- a/src/Layers/BE/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al +++ b/src/Layers/BE/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al @@ -1170,8 +1170,12 @@ table 254 "VAT Entry" VATEntryLocal.Copy(Rec); VATEntryLocal.SetRange("G/L Acc. No.", ''); if WithUI then begin - if ShowConfirm then - Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + if GuiAllowed() then begin + if ShowConfirm and not Response then + Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + end else + // Background execution has no user to confirm with; proceed so the report can run unattended. + Response := true; if not Response then exit; @@ -1321,6 +1325,9 @@ table 254 "VAT Entry" VATEntryUpdate.SetRange("G/L Acc. No.", ''); VATEntryUpdate.SetFilter("Entry No.", EntryNoFilter.ToText()); VATEntryUpdate.ModifyAll("G/L Acc. No.", GLAccountNo, false); + // Persist each batch so a long-running adjustment that times out can resume from where it + // left off instead of restarting from scratch and never completing. + Commit(); EntryNoFilter.Clear(); TotalChunkDuration += CurrentDateTime() - StartTime; ChunkCount += 1; diff --git a/src/Layers/CH/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al b/src/Layers/CH/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al index 6aa2dc10ca..4d24c9a72b 100644 --- a/src/Layers/CH/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al +++ b/src/Layers/CH/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al @@ -1193,8 +1193,12 @@ table 254 "VAT Entry" VATEntryLocal.Copy(Rec); VATEntryLocal.SetRange("G/L Acc. No.", ''); if WithUI then begin - if ShowConfirm then - Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + if GuiAllowed() then begin + if ShowConfirm and not Response then + Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + end else + // Background execution has no user to confirm with; proceed so the report can run unattended. + Response := true; if not Response then exit; @@ -1344,6 +1348,9 @@ table 254 "VAT Entry" VATEntryUpdate.SetRange("G/L Acc. No.", ''); VATEntryUpdate.SetFilter("Entry No.", EntryNoFilter.ToText()); VATEntryUpdate.ModifyAll("G/L Acc. No.", GLAccountNo, false); + // Persist each batch so a long-running adjustment that times out can resume from where it + // left off instead of restarting from scratch and never completing. + Commit(); EntryNoFilter.Clear(); TotalChunkDuration += CurrentDateTime() - StartTime; ChunkCount += 1; diff --git a/src/Layers/DACH/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al b/src/Layers/DACH/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al index 77ab015431..2fe622dea4 100644 --- a/src/Layers/DACH/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al +++ b/src/Layers/DACH/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al @@ -1153,8 +1153,12 @@ table 254 "VAT Entry" VATEntryLocal.Copy(Rec); VATEntryLocal.SetRange("G/L Acc. No.", ''); if WithUI then begin - if ShowConfirm then - Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + if GuiAllowed() then begin + if ShowConfirm and not Response then + Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + end else + // Background execution has no user to confirm with; proceed so the report can run unattended. + Response := true; if not Response then exit; @@ -1304,6 +1308,9 @@ table 254 "VAT Entry" VATEntryUpdate.SetRange("G/L Acc. No.", ''); VATEntryUpdate.SetFilter("Entry No.", EntryNoFilter.ToText()); VATEntryUpdate.ModifyAll("G/L Acc. No.", GLAccountNo, false); + // Persist each batch so a long-running adjustment that times out can resume from where it + // left off instead of restarting from scratch and never completing. + Commit(); EntryNoFilter.Clear(); TotalChunkDuration += CurrentDateTime() - StartTime; ChunkCount += 1; diff --git a/src/Layers/ES/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al b/src/Layers/ES/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al index e400993712..0dc9f24abe 100644 --- a/src/Layers/ES/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al +++ b/src/Layers/ES/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al @@ -1274,8 +1274,12 @@ table 254 "VAT Entry" VATEntryLocal.Copy(Rec); VATEntryLocal.SetRange("G/L Acc. No.", ''); if WithUI then begin - if ShowConfirm then - Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + if GuiAllowed() then begin + if ShowConfirm and not Response then + Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + end else + // Background execution has no user to confirm with; proceed so the report can run unattended. + Response := true; if not Response then exit; @@ -1425,6 +1429,9 @@ table 254 "VAT Entry" VATEntryUpdate.SetRange("G/L Acc. No.", ''); VATEntryUpdate.SetFilter("Entry No.", EntryNoFilter.ToText()); VATEntryUpdate.ModifyAll("G/L Acc. No.", GLAccountNo, false); + // Persist each batch so a long-running adjustment that times out can resume from where it + // left off instead of restarting from scratch and never completing. + Commit(); EntryNoFilter.Clear(); TotalChunkDuration += CurrentDateTime() - StartTime; ChunkCount += 1; diff --git a/src/Layers/FI/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al b/src/Layers/FI/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al index 079ae9b7e9..8850605176 100644 --- a/src/Layers/FI/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al +++ b/src/Layers/FI/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al @@ -1130,8 +1130,12 @@ table 254 "VAT Entry" VATEntryLocal.Copy(Rec); VATEntryLocal.SetRange("G/L Acc. No.", ''); if WithUI then begin - if ShowConfirm then - Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + if GuiAllowed() then begin + if ShowConfirm and not Response then + Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + end else + // Background execution has no user to confirm with; proceed so the report can run unattended. + Response := true; if not Response then exit; @@ -1281,6 +1285,9 @@ table 254 "VAT Entry" VATEntryUpdate.SetRange("G/L Acc. No.", ''); VATEntryUpdate.SetFilter("Entry No.", EntryNoFilter.ToText()); VATEntryUpdate.ModifyAll("G/L Acc. No.", GLAccountNo, false); + // Persist each batch so a long-running adjustment that times out can resume from where it + // left off instead of restarting from scratch and never completing. + Commit(); EntryNoFilter.Clear(); TotalChunkDuration += CurrentDateTime() - StartTime; ChunkCount += 1; diff --git a/src/Layers/FR/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al b/src/Layers/FR/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al index 29f8e0f95c..80d76bc4a1 100644 --- a/src/Layers/FR/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al +++ b/src/Layers/FR/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al @@ -1148,8 +1148,12 @@ table 254 "VAT Entry" VATEntryLocal.Copy(Rec); VATEntryLocal.SetRange("G/L Acc. No.", ''); if WithUI then begin - if ShowConfirm then - Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + if GuiAllowed() then begin + if ShowConfirm and not Response then + Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + end else + // Background execution has no user to confirm with; proceed so the report can run unattended. + Response := true; if not Response then exit; @@ -1299,6 +1303,9 @@ table 254 "VAT Entry" VATEntryUpdate.SetRange("G/L Acc. No.", ''); VATEntryUpdate.SetFilter("Entry No.", EntryNoFilter.ToText()); VATEntryUpdate.ModifyAll("G/L Acc. No.", GLAccountNo, false); + // Persist each batch so a long-running adjustment that times out can resume from where it + // left off instead of restarting from scratch and never completing. + Commit(); EntryNoFilter.Clear(); TotalChunkDuration += CurrentDateTime() - StartTime; ChunkCount += 1; diff --git a/src/Layers/IT/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al b/src/Layers/IT/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al index 28d0305e15..a8ac141409 100644 --- a/src/Layers/IT/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al +++ b/src/Layers/IT/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al @@ -1476,8 +1476,12 @@ table 254 "VAT Entry" VATEntryLocal.Copy(Rec); VATEntryLocal.SetRange("G/L Acc. No.", ''); if WithUI then begin - if ShowConfirm then - Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + if GuiAllowed() then begin + if ShowConfirm and not Response then + Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + end else + // Background execution has no user to confirm with; proceed so the report can run unattended. + Response := true; if not Response then exit; @@ -1627,6 +1631,9 @@ table 254 "VAT Entry" VATEntryUpdate.SetRange("G/L Acc. No.", ''); VATEntryUpdate.SetFilter("Entry No.", EntryNoFilter.ToText()); VATEntryUpdate.ModifyAll("G/L Acc. No.", GLAccountNo, false); + // Persist each batch so a long-running adjustment that times out can resume from where it + // left off instead of restarting from scratch and never completing. + Commit(); EntryNoFilter.Clear(); TotalChunkDuration += CurrentDateTime() - StartTime; ChunkCount += 1; diff --git a/src/Layers/NA/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al b/src/Layers/NA/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al index f6770b5f72..2150a1cf2f 100644 --- a/src/Layers/NA/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al +++ b/src/Layers/NA/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al @@ -1150,8 +1150,12 @@ table 254 "VAT Entry" VATEntryLocal.Copy(Rec); VATEntryLocal.SetRange("G/L Acc. No.", ''); if WithUI then begin - if ShowConfirm then - Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + if GuiAllowed() then begin + if ShowConfirm and not Response then + Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + end else + // Background execution has no user to confirm with; proceed so the report can run unattended. + Response := true; if not Response then exit; @@ -1301,6 +1305,9 @@ table 254 "VAT Entry" VATEntryUpdate.SetRange("G/L Acc. No.", ''); VATEntryUpdate.SetFilter("Entry No.", EntryNoFilter.ToText()); VATEntryUpdate.ModifyAll("G/L Acc. No.", GLAccountNo, false); + // Persist each batch so a long-running adjustment that times out can resume from where it + // left off instead of restarting from scratch and never completing. + Commit(); EntryNoFilter.Clear(); TotalChunkDuration += CurrentDateTime() - StartTime; ChunkCount += 1; diff --git a/src/Layers/NL/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al b/src/Layers/NL/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al index 486b43e9b5..3b7436a36d 100644 --- a/src/Layers/NL/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al +++ b/src/Layers/NL/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al @@ -1134,8 +1134,12 @@ table 254 "VAT Entry" VATEntryLocal.Copy(Rec); VATEntryLocal.SetRange("G/L Acc. No.", ''); if WithUI then begin - if ShowConfirm then - Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + if GuiAllowed() then begin + if ShowConfirm and not Response then + Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + end else + // Background execution has no user to confirm with; proceed so the report can run unattended. + Response := true; if not Response then exit; @@ -1285,6 +1289,9 @@ table 254 "VAT Entry" VATEntryUpdate.SetRange("G/L Acc. No.", ''); VATEntryUpdate.SetFilter("Entry No.", EntryNoFilter.ToText()); VATEntryUpdate.ModifyAll("G/L Acc. No.", GLAccountNo, false); + // Persist each batch so a long-running adjustment that times out can resume from where it + // left off instead of restarting from scratch and never completing. + Commit(); EntryNoFilter.Clear(); TotalChunkDuration += CurrentDateTime() - StartTime; ChunkCount += 1; diff --git a/src/Layers/NO/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al b/src/Layers/NO/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al index 949682ce94..37475efe86 100644 --- a/src/Layers/NO/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al +++ b/src/Layers/NO/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al @@ -1152,8 +1152,12 @@ table 254 "VAT Entry" VATEntryLocal.Copy(Rec); VATEntryLocal.SetRange("G/L Acc. No.", ''); if WithUI then begin - if ShowConfirm then - Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + if GuiAllowed() then begin + if ShowConfirm and not Response then + Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + end else + // Background execution has no user to confirm with; proceed so the report can run unattended. + Response := true; if not Response then exit; @@ -1303,6 +1307,9 @@ table 254 "VAT Entry" VATEntryUpdate.SetRange("G/L Acc. No.", ''); VATEntryUpdate.SetFilter("Entry No.", EntryNoFilter.ToText()); VATEntryUpdate.ModifyAll("G/L Acc. No.", GLAccountNo, false); + // Persist each batch so a long-running adjustment that times out can resume from where it + // left off instead of restarting from scratch and never completing. + Commit(); EntryNoFilter.Clear(); TotalChunkDuration += CurrentDateTime() - StartTime; ChunkCount += 1; diff --git a/src/Layers/RU/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al b/src/Layers/RU/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al index 77b338d7ab..74db5b9c85 100644 --- a/src/Layers/RU/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al +++ b/src/Layers/RU/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al @@ -1298,8 +1298,12 @@ table 254 "VAT Entry" VATEntryLocal.Copy(Rec); VATEntryLocal.SetRange("G/L Acc. No.", ''); if WithUI then begin - if ShowConfirm then - Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + if GuiAllowed() then begin + if ShowConfirm and not Response then + Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + end else + // Background execution has no user to confirm with; proceed so the report can run unattended. + Response := true; if not Response then exit; @@ -1449,6 +1453,9 @@ table 254 "VAT Entry" VATEntryUpdate.SetRange("G/L Acc. No.", ''); VATEntryUpdate.SetFilter("Entry No.", EntryNoFilter.ToText()); VATEntryUpdate.ModifyAll("G/L Acc. No.", GLAccountNo, false); + // Persist each batch so a long-running adjustment that times out can resume from where it + // left off instead of restarting from scratch and never completing. + Commit(); EntryNoFilter.Clear(); TotalChunkDuration += CurrentDateTime() - StartTime; ChunkCount += 1; diff --git a/src/Layers/W1/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al b/src/Layers/W1/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al index 1fc6d551aa..bbba9e8220 100644 --- a/src/Layers/W1/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al +++ b/src/Layers/W1/BaseApp/Finance/VAT/Ledger/VATEntry.Table.al @@ -1130,8 +1130,12 @@ table 254 "VAT Entry" VATEntryLocal.Copy(Rec); VATEntryLocal.SetRange("G/L Acc. No.", ''); if WithUI then begin - if ShowConfirm then - Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + if GuiAllowed() then begin + if ShowConfirm and not Response then + Response := ConfirmManagement.GetResponseOrDefault(ConfirmAdjustQst, false); + end else + // Background execution has no user to confirm with; proceed so the report can run unattended. + Response := true; if not Response then exit; @@ -1281,6 +1285,9 @@ table 254 "VAT Entry" VATEntryUpdate.SetRange("G/L Acc. No.", ''); VATEntryUpdate.SetFilter("Entry No.", EntryNoFilter.ToText()); VATEntryUpdate.ModifyAll("G/L Acc. No.", GLAccountNo, false); + // Persist each batch so a long-running adjustment that times out can resume from where it + // left off instead of restarting from scratch and never completing. + Commit(); EntryNoFilter.Clear(); TotalChunkDuration += CurrentDateTime() - StartTime; ChunkCount += 1; diff --git a/src/Layers/W1/Tests/VAT/ERMGLVATReconciliation.Codeunit.al b/src/Layers/W1/Tests/VAT/ERMGLVATReconciliation.Codeunit.al index 3ab77e6d47..2f4a3f2579 100644 --- a/src/Layers/W1/Tests/VAT/ERMGLVATReconciliation.Codeunit.al +++ b/src/Layers/W1/Tests/VAT/ERMGLVATReconciliation.Codeunit.al @@ -1,3 +1,5 @@ +using Microsoft.Finance.VAT.Ledger; + codeunit 134991 "ERM G/L - VAT Reconciliation" { Subtype = Test; @@ -21,6 +23,7 @@ codeunit 134991 "ERM G/L - VAT Reconciliation" ConfirmAdjustQst: Label 'Do you want to fill the G/L Account No. field in VAT entries that are linked to G/L Entries?'; + [TransactionModel(TransactionModel::AutoCommit)] [Test] procedure VATEntrySetGLAccountNumberWithoutUI() var @@ -65,6 +68,7 @@ codeunit 134991 "ERM G/L - VAT Reconciliation" VerifyGLAccountNoInVATEntries(VATEntry, GLAccountNo); end; + [TransactionModel(TransactionModel::AutoCommit)] [Test] [HandlerFunctions('ConfirmHandlerSetGLAccountNo')] procedure VATEntrySetGLAccountNumberWithUIConfirmYes() @@ -87,6 +91,7 @@ codeunit 134991 "ERM G/L - VAT Reconciliation" VerifyGLAccountNoInVATEntries(VATEntry, GLAccountNo); end; + [TransactionModel(TransactionModel::AutoCommit)] [Test] procedure CallSetGLAccountNumberFromVATEntriesPage() var @@ -112,6 +117,32 @@ codeunit 134991 "ERM G/L - VAT Reconciliation" VerifyGLAccountNoInVATEntries(VATEntry, GLAccountNo); end; + [TransactionModel(TransactionModel::AutoCommit)] + [Test] + procedure SetGLAccountNoEventPreApprovalSkipsConfirm() + var + VATEntry: Record "VAT Entry"; + GLVATReconAdjustSubs: Codeunit "GL VAT Recon. Adjust Subs."; + GLAccountNo: array[4] of Code[20]; + begin + // [SCENARIO 640489] When a subscriber to OnBeforeSetGLAccountNo pre-approves the adjustment, the confirm is skipped and processing continues, so the report can run unattended + Initialize(); + + // [GIVEN] 4 G/L Entry - VAT Entry Links, where two of them refer to VAT Entries whose G/L Account Number field is blank + CreateVATEntriesGLEntriesWithLink(GLAccountNo, TransactionNo); + VATEntry.SetRange("Transaction No.", TransactionNo); + + // [GIVEN] A subscriber that pre-approves the adjustment via OnBeforeSetGLAccountNo (Response := true) + BindSubscription(GLVATReconAdjustSubs); + + // [WHEN] The SetGLAccountNo function is called with WithUI set to true (which also requests a confirm) and no ConfirmHandler is registered + VATEntry.SetGLAccountNo(true); + UnbindSubscription(GLVATReconAdjustSubs); + + // [THEN] The G/L Account Number field is correctly set for all the test VAT Entries, without any confirm being raised + VerifyGLAccountNoInVATEntries(VATEntry, GLAccountNo); + end; + local procedure Initialize() begin LibraryTestInitialize.OnTestInitialize(Codeunit::"ERM G/L - VAT Reconciliation"); diff --git a/src/Layers/W1/Tests/VAT/GLVATReconAdjustSubscriber.Codeunit.al b/src/Layers/W1/Tests/VAT/GLVATReconAdjustSubscriber.Codeunit.al new file mode 100644 index 0000000000..4d67a77e51 --- /dev/null +++ b/src/Layers/W1/Tests/VAT/GLVATReconAdjustSubscriber.Codeunit.al @@ -0,0 +1,14 @@ +using Microsoft.Finance.VAT.Ledger; + +codeunit 134241 "GL VAT Recon. Adjust Subs." +{ + EventSubscriberInstance = Manual; + + [EventSubscriber(ObjectType::Table, Database::"VAT Entry", OnBeforeSetGLAccountNo, '', false, false)] + local procedure PreApproveAdjustmentOnBeforeSetGLAccountNo(var VATEntry: Record "VAT Entry"; var IsHandled: Boolean; var Response: Boolean) + begin + // Pre-approve the adjustment via the event so the confirm dialog is skipped and processing continues. + // IsHandled is intentionally left false so the standard G/L Account No. adjustment logic still runs. + Response := true; + end; +}