mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-08-06 09:26:52 +01:00
Move eight net-new rules into the Microsoft layer, remove six overlapping articles, and update review skill discovery and references. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0b130227-d418-4bc0-9e7d-ec6a37adf039 Co-authored-by: Jesper Schulz-Wedde <jesper.schulzwedde@microsoft.com>
26 lines
791 B
AL
26 lines
791 B
AL
table 50122 "FieldError vs TestField Bad"
|
|
{
|
|
fields
|
|
{
|
|
field(1; "No."; Code[20]) { }
|
|
field(2; "Posting Date"; Date) { }
|
|
field(3; "Amount"; Decimal) { }
|
|
}
|
|
|
|
procedure PostDocument()
|
|
begin
|
|
// FieldError performs no comparison and raises as soon as it is
|
|
// reached, so this "check" terminates PostDocument every time — the
|
|
// Posting Date is never actually tested, and the amount rule below is
|
|
// dead code.
|
|
FieldError("Posting Date", 'must be filled in');
|
|
|
|
if IsAmountOutsideAllowedRange("Amount") then
|
|
Error('Amount is out of range.');
|
|
end;
|
|
|
|
local procedure IsAmountOutsideAllowedRange(Value: Decimal): Boolean
|
|
begin
|
|
exit((Value < 0) or (Value > 1000000));
|
|
end;
|
|
}
|