bcquality/microsoft/knowledge/error-handling/fielderror-default-message-logic.good.al
Jesper Schulz-Wedde 3d29c172a9
Promote validated community knowledge (#105)
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>
2026-07-14 14:20:27 +02:00

21 lines
684 B
AL

table 50120 "FieldError Default Good"
{
fields
{
field(1; "No."; Code[20]) { }
field(2; "Discount %"; Decimal) { }
field(3; "Currency Code"; Code[10]) { }
}
procedure ValidateForRelease()
begin
// TestField checks this required-field condition and raises the error
// with caption and record context supplied by the framework.
TestField("Currency Code");
// Condition already evaluated: pass only a lowercase predicate so it
// reads as one sentence after the auto-inserted caption and value.
if "Discount %" > 100 then
FieldError("Discount %", 'cannot exceed 100');
end;
}