Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ permissionset 1680 "Email Logging - Obj."
codeunit "Email Logging API Client" = X,
codeunit "Email Logging API Helper" = X,
codeunit "Email Logging Message" = X,
codeunit "Email Logging Install" = X,
codeunit "Email Logging Upgrade" = X,
page "Email Logging Setup" = X,
page "Email Logging Setup Wizard" = X,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ tableextension 6810 "WHT Empl. Ledger Entry Ext" extends "Employee Ledger Entry"
{
Caption = 'Withholding Tax Amount';
AutoFormatType = 1;
AutoFormatExpression = Rec."Currency Code";
Editable = false;
DataClassification = CustomerContent;
ToolTip = 'Specifies the withholding tax amount for the employee ledger entry.';
Expand All @@ -22,6 +23,7 @@ tableextension 6810 "WHT Empl. Ledger Entry Ext" extends "Employee Ledger Entry"
{
Caption = 'Withholding Tax Base Amount';
AutoFormatType = 1;
AutoFormatExpression = Rec."Currency Code";
Editable = false;
DataClassification = CustomerContent;
ToolTip = 'Specifies the withholding tax base amount for the employee ledger entry.';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,16 @@ table 6794 "WHT Threshold Accumulator"
{
Caption = 'Accumulated Base Amount';
AutoFormatType = 1;
// The accumulator only ever holds local currency amounts.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Data\ Modeling}$

The new LCY-only AutoFormatExpression ('') on "WHT Threshold Accumulator" fields "Accumulated Base Amount" and "Accumulated WHT Amount" hard-codes these totals as local-currency values, but the accumulator is populated from "Withholding Tax Entry"."Taxable Base Amount", and that source table itself stores a "Currency Code" and uses Rec."Currency Code" for its own AutoFormatExpression in this same PR. This makes the added comment's LCY-only claim architecturally inconsistent with the actual data flow, and risks mislabeling accumulated foreign-currency amounts as local currency in the UI. Either confirm/enforce that only LCY amounts ever flow into the accumulator (e.g. via validation or a comment referencing where that invariant is enforced), or source the AutoFormatExpression from a persisted currency-code field consistent with the source entries.

Agent judgement — not directly backed by a BCQuality knowledge article.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.33.4

AutoFormatExpression = '';
ToolTip = 'Specifies the accumulated base amount for the withholding tax threshold accumulator.';
}
field(9; "Accumulated WHT Amount"; Decimal)
{
Caption = 'Accumulated Withholding Tax Amount';
AutoFormatType = 1;
// The accumulator only ever holds local currency amounts.
AutoFormatExpression = '';
ToolTip = 'Specifies the accumulated withholding tax amount for the withholding tax threshold accumulator.';
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ table 6788 "Withholding Tax Entry"
{
Caption = 'Taxable Base Amount';
AutoFormatType = 1;
AutoFormatExpression = Rec."Currency Code";
Editable = false;
}
field(28101; "Pymt. Disc. Diff. Base"; Decimal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1164,10 +1164,12 @@ page 189 "Incoming Document"
ReplaceMainAttachmentEnabled := Rec.CanReplaceMainAttachment();
end;

#pragma warning disable AL0547 // Accepted violation: turning off global variable access is a breaking change for existing subscribers of this published event.
[IntegrationEvent(true, true)]
local procedure OnCloseIncomingDocumentFromAction(var IncomingDocument: Record "Incoming Document")
begin
end;
#pragma warning restore AL0547

local procedure VerifyCanBeSentToOCR(): Boolean
begin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ page 103 "Account Schedule Names"
{
Caption = 'F&unctions';
Image = "Action";
Visible = false;
action("Export Schedules to ASC format")
{
ApplicationArea = Basic, Suite;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ codeunit 143001 "NL XML Read Helper"
var
Node: DotNet XmlNode;
begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror GetNodeByElementName(ElementName, Node);
#pragma warning restore AS0058, PTE0007
Assert.ExpectedError('Element is missing!');
end;

Expand All @@ -66,7 +68,9 @@ codeunit 143001 "NL XML Read Helper"
var
Attribute: DotNet XmlAttribute;
begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror GetAttributeFromElement(ElementName, AttributeName, Attribute);
#pragma warning restore AS0058, PTE0007
Assert.ExpectedError('Attribute is missing!');
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ codeunit 143001 "NO XML Read Helper"
var
Node: DotNet XmlNode;
begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror GetNodeByElementName(ElementName, Node);
#pragma warning restore AS0058, PTE0007
Assert.ExpectedError(StrSubstNo(MissingElementErr, ElementName));
end;

Expand Down Expand Up @@ -87,7 +89,9 @@ codeunit 143001 "NO XML Read Helper"
var
Attribute: DotNet XmlAttribute;
begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror GetAttributeFromElement(ElementName, AttributeName, Attribute);
#pragma warning restore AS0058, PTE0007
Assert.ExpectedError('Attribute is missing!');
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,14 @@ codeunit 1545 "Workflow Webhook Notification"
end;
end;

#pragma warning disable AL0547 // Accepted violation: turning off global variable access is a breaking change for existing subscribers of this published event.
[TryFunction]
[IntegrationEvent(true, true)]
[Scope('OnPrem')]
procedure OnPostNotificationRequest(DataID: Guid; WorkflowStepInstanceID: Guid; NotificationUrl: Text; RequestedByUserEmail: Text)
begin
end;
#pragma warning restore AL0547

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Workflow Webhook Notification", 'OnPostNotificationRequest', '', false, false)]
[TryFunction]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1163,10 +1163,12 @@ page 189 "Incoming Document"
ReplaceMainAttachmentEnabled := Rec.CanReplaceMainAttachment();
end;

#pragma warning disable AL0547 // Accepted violation: turning off global variable access is a breaking change for existing subscribers of this published event.
[IntegrationEvent(true, true)]
local procedure OnCloseIncomingDocumentFromAction(var IncomingDocument: Record "Incoming Document")
begin
end;
#pragma warning restore AL0547

local procedure VerifyCanBeSentToOCR(): Boolean
begin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -903,10 +903,12 @@ page 190 "Incoming Documents"
AutomaticCreationActionsAreEnabled := Rec."Data Exchange Type" <> '';
end;

#pragma warning disable AL0547 // Accepted violation: turning off global variable access is a breaking change for existing subscribers of this published event.
[IntegrationEvent(true, true)]
local procedure OnCloseIncomingDocumentsFromActions(var IncomingDocument: Record "Incoming Document")
begin
end;
#pragma warning restore AL0547

local procedure SetProcessedDocumentsVisibility(ShowProcessedItems: Boolean)
begin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ codeunit 132207 "Library - Assembly"
if ExpectedError = '' then
BatchPostAssemblyOrders.RunModal()
else begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror BatchPostAssemblyOrders.RunModal();
#pragma warning restore AS0058, PTE0007
Assert.IsTrue(StrPos(GetLastErrorText, ExpectedError) > 0, 'Actual:' + GetLastErrorText);
ClearLastError();
end;
Expand Down Expand Up @@ -1506,7 +1508,9 @@ codeunit 132207 "Library - Assembly"
if ExpectedError = '' then
AssemblyPost.Run(AssemblyHeader)
else begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror AssemblyPost.Run(AssemblyHeader);
#pragma warning restore AS0058, PTE0007
Assert.IsTrue(StrPos(GetLastErrorText, ExpectedError) > 0,
'Expected:' + ExpectedError + '. Actual:' + GetLastErrorText);
ClearLastError();
Expand Down Expand Up @@ -1742,7 +1746,9 @@ codeunit 132207 "Library - Assembly"
if ExpectedError = '' then
AsmPostCtrl.Undo(PostedAssemblyHeader, RestoreAO)
else begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror AsmPostCtrl.Undo(PostedAssemblyHeader, RestoreAO);
#pragma warning restore AS0058, PTE0007
Assert.IsTrue(StrPos(GetLastErrorText, ExpectedError) > 0, 'Actual:' + GetLastErrorText);
ClearLastError();
end;
Expand All @@ -1754,7 +1760,9 @@ codeunit 132207 "Library - Assembly"
begin
Commit();
if AssemblyHeader.Quantity = 0 then begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror AssemblyHeader.UpdateUnitCost();
#pragma warning restore AS0058, PTE0007
Assert.AreEqual(
StrSubstNo(ErrorZeroQty, AssemblyHeader."No."), GetLastErrorText,
'Actual:' + GetLastErrorText + '; Expected:' + StrSubstNo(ErrorZeroQty, AssemblyHeader."No."));
Expand All @@ -1766,7 +1774,9 @@ codeunit 132207 "Library - Assembly"
if Item."Costing Method" <> Item."Costing Method"::Standard then
AssemblyHeader.UpdateUnitCost()
else begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror AssemblyHeader.UpdateUnitCost();
#pragma warning restore AS0058, PTE0007
Assert.IsTrue(StrPos(GetLastErrorText, ErrorStdCost) > 0, 'Actual:' + GetLastErrorText + '; Expected:' + ErrorStdCost);
ClearLastError();
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1919,7 +1919,9 @@ codeunit 139164 "Library - CRM Integration"
JobQueueEntryID := JobQueueEntry.ID;
JobQueueEntry.SetStatus(JobQueueEntry.Status::Ready);
if HandleError then begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror LibraryJobQueue.RunJobQueueDispatcher(JobQueueEntry);
#pragma warning restore AS0058, PTE0007
LibraryJobQueue.RunJobQueueErrorHandler(JobQueueEntry);
end else
LibraryJobQueue.RunJobQueueDispatcher(JobQueueEntry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ codeunit 132458 "Library - Job Queue"
JobQueueEntry.Status := JobQueueEntry.Status::Ready;
JobQueueEntry.Modify();
if WithErrorHandler then begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror RunJobQueueDispatcher(JobQueueEntry);
#pragma warning restore AS0058, PTE0007
RunJobQueueErrorHandler(JobQueueEntry);
end
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ codeunit 132216 "Library - Permissions Verify"
RecordRef: RecordRef;
begin
RecordRef.Open(TableNo);
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror RecordRef.FindFirst();
#pragma warning restore AS0058, PTE0007
Assert.ExpectedError(StrSubstNo(MissingPermissionErr, Format(RecordRef.Caption)))
end;

Expand All @@ -116,10 +118,14 @@ codeunit 132216 "Library - Permissions Verify"
begin
RecordRef.Init();

#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror RecordRef.Insert(true);
#pragma warning restore AS0058, PTE0007
Assert.IsFalse(RecordRef.WritePermission, StrSubstNo(SupplementalPermissionErr, 'Insert', Format(RecordRef.Caption)));

#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror RecordRef.Delete(true);
#pragma warning restore AS0058, PTE0007
Assert.IsFalse(RecordRef.WritePermission, StrSubstNo(SupplementalPermissionErr, 'Delete', Format(RecordRef.Caption)));
end;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,13 @@ codeunit 131011 "Library - Post. Prev. Handler"
InsertRecord(RecVar);
Assert.IsTrue(GenJnlPostPreview.IsActive(), 'GenJnlPostPreview.IsActive');
if InvokeCommit then
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror Commit()
#pragma warning restore AS0058, PTE0007
else
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror GenJnlPostPreview.ThrowError();
#pragma warning restore AS0058, PTE0007
Result := false;
end;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ codeunit 131335 "Library - XML Read"
[RunOnClient]
XMLNode: DotNet XmlNode;
begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror GetNodeByElementName(NodeName, XMLNode);
#pragma warning restore AS0058, PTE0007
Assert.ExpectedErrorCode('Dialog');
Assert.ExpectedError(StrSubstNo(MissingElementErr, NodeName));
end;
Expand All @@ -224,7 +226,9 @@ codeunit 131335 "Library - XML Read"
[RunOnClient]
Node: DotNet XmlNode;
begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror LocateNodeInSubtree(Node, RootNodeName, NodeName, '', NodeMatchCriteria::FindByName);
#pragma warning restore AS0058, PTE0007
Assert.ExpectedErrorCode('Dialog');
Assert.ExpectedError(StrSubstNo(NotFoundAnyInSubtreeErr, NodeName, RootNodeName));
end;
Expand All @@ -234,7 +238,9 @@ codeunit 131335 "Library - XML Read"
[RunOnClient]
Node: DotNet XmlNode;
begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror LocateNodeInSubtree(Node, RootNodeName, NodeName, '', NodeMatchCriteria::FindByName);
#pragma warning restore AS0058, PTE0007
Assert.ExpectedErrorCode('Dialog');
Assert.ExpectedError(StrSubstNo(MissingElementErr, NodeName));
end;
Expand All @@ -261,7 +267,9 @@ codeunit 131335 "Library - XML Read"

procedure VerifyAttributeAbsenceInSubtree(RootNodeName: Text; NodeName: Text; AttributeName: Text)
begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror GetAttributeValueInSubtree(RootNodeName, NodeName, AttributeName);
#pragma warning restore AS0058, PTE0007
Assert.ExpectedErrorCode('Dialog');
Assert.ExpectedError(StrSubstNo(AttributeNotFoundErr, NodeName, RootNodeName, AttributeName));
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ codeunit 131341 "Library - XML Read OnServer"
var
XMLNode: DotNet XmlNode;
begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror GetNodeByElementName(NodeName, XMLNode);
#pragma warning restore AS0058, PTE0007
Assert.ExpectedErrorCode('Dialog');
Assert.ExpectedError(StrSubstNo(MissingElementErr, NodeName));
end;
Expand All @@ -228,7 +230,9 @@ codeunit 131341 "Library - XML Read OnServer"
var
Node: DotNet XmlNode;
begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror LocateNodeInSubtree(Node, RootNodeName, NodeName, '', NodeMatchCriteria::FindByName);
#pragma warning restore AS0058, PTE0007
Assert.ExpectedErrorCode('Dialog');
Assert.ExpectedError(StrSubstNo(NotFoundAnyInSubtreeErr, NodeName, RootNodeName));
end;
Expand All @@ -238,7 +242,9 @@ codeunit 131341 "Library - XML Read OnServer"
var
Node: DotNet XmlNode;
begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror LocateNodeInSubtree(Node, RootNodeName, NodeName, '', NodeMatchCriteria::FindByName);
#pragma warning restore AS0058, PTE0007
Assert.ExpectedErrorCode('Dialog');
Assert.ExpectedError(StrSubstNo(MissingElementErr, NodeName));
end;
Expand Down Expand Up @@ -273,7 +279,9 @@ codeunit 131341 "Library - XML Read OnServer"
[Scope('OnPrem')]
procedure VerifyAttributeAbsenceInSubtree(RootNodeName: Text; NodeName: Text; AttributeName: Text)
begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror GetAttributeValueInSubtree(RootNodeName, NodeName, AttributeName);
#pragma warning restore AS0058, PTE0007
Assert.ExpectedErrorCode('Dialog');
Assert.ExpectedError(StrSubstNo(AttributeNotFoundErr, NodeName, RootNodeName, AttributeName));
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ codeunit 131337 "Library - XPath XML Reader"
var
Node: DotNet XmlNode;
begin
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror GetNodeByElementName(ElementName, Node);
#pragma warning restore AS0058, PTE0007
Assert.ExpectedError('Element is missing!');
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ codeunit 130231 "Test Proxy Notification Mgt."
RemoveIgnoringNotifications();
IsSuccess := not HasNotificationContextEntries();
if not IsSuccess then
#pragma warning disable AS0058, PTE0007 // Accepted violation: this is a test library helper that intentionally wraps asserterror for use by test codeunits.
asserterror Error(NotificationErr, GetFirstRecordIDText());
#pragma warning restore AS0058, PTE0007
end;
end;

Expand Down
Loading
Loading