mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-05 14:46:55 +01:00
The previous bad fixture (literal '*' delimiters, no layout/font/provider evidence) no longer matched the narrowed routing cue. It now shows an IDAutomation 1D provider path that calls EncodeFont without ValidateInput, which is visible in AL alone. Article Anti Pattern and Source updated to describe this variant (verified: IDAutomation 1D Provider's EncodeFont does not call IsValidInput). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
41 lines
1.5 KiB
AL
41 lines
1.5 KiB
AL
report 50110 "Sample Item Barcode Label"
|
|
{
|
|
UsageCategory = Tasks;
|
|
ApplicationArea = All;
|
|
Caption = 'Sample Item Barcode Label';
|
|
|
|
dataset
|
|
{
|
|
dataitem(Item; Item)
|
|
{
|
|
column(No_; "No.") { }
|
|
column(Barcode; BarcodeText) { }
|
|
|
|
trigger OnAfterGetRecord()
|
|
var
|
|
BarcodeFontProvider: Interface "Barcode Font Provider";
|
|
begin
|
|
// WRONG: a one-dimensional IDAutomation provider path that
|
|
// calls EncodeFont without ValidateInput. "Barcode Font
|
|
// Provider" (1D) declares both, and IDAutomation 1D
|
|
// Provider's EncodeFont does not validate on its own - it
|
|
// hands the text straight to the font encoder. Code 39
|
|
// accepts only 0-9, A-Z, space and - . $ / + % *, but an
|
|
// Item "No." can legally contain characters outside that
|
|
// set (e.g. "_" or "#"). Such a value is never rejected;
|
|
// it silently reaches the font as an unscannable barcode.
|
|
BarcodeFontProvider := Enum::"Barcode Font Provider"::IDAutomation1D;
|
|
BarcodeText := BarcodeFontProvider.EncodeFont("No.", BarcodeSymbology);
|
|
end;
|
|
}
|
|
}
|
|
|
|
var
|
|
BarcodeSymbology: Enum "Barcode Symbology";
|
|
BarcodeText: Text;
|
|
|
|
trigger OnInitReport()
|
|
begin
|
|
BarcodeSymbology := Enum::"Barcode Symbology"::Code39;
|
|
end;
|
|
}
|