bcquality/microsoft/knowledge/data-modeling/report-barcodes-must-use-barcode-module-and-production-font-name.bad.al
Michael Dieringer eb9cae0af4 Fix 5 merge-critical issues from Jesper's 2026-09-24 review round
- activate-new-price-calculation-handler-via-onfindsupportedsetup: Default
  := true is required only for the fallback branch of PriceCalculationMgt's
  two-stage FindSetup - a handler reachable via a specific Dtld. Price
  Calculation Setup row needs no Default. Softened the article and its
  worklist cue accordingly. Also fixed an undefined "Sample Price Calc -
  Special" codeunit referenced but never declared in the eval fixtures -
  added a real implementation of interface "Price Calculation" with stub
  methods.
- new-price-source-must-add-candidate-and-trigger-recalculation: the good
  fixture called UpdateUnitPriceByField directly, which is a silent no-op
  without a prior PlanPriceCalcByField call (FieldCausedPriceCalculation
  gating, verified against SalesLine.Table.al). Switched to the public
  UpdateUnitPrice wrapper, matching real BCApps usage in
  ItemReferenceManagement.Codeunit.al.
- report-barcodes-must-use-barcode-module-and-production-font-name: split
  the 1D (ValidateInput + EncodeFont) and 2D (EncodeFont only) Barcode Font
  Provider interfaces, which the article previously conflated. Reframed the
  Code 39 anti-pattern around demonstrable encoding/checksum mismatch
  (verified against IDA1DCode39Encoder.Codeunit.al's real '(value)' output)
  rather than rejecting all manual delimiter use, since '*' is a legitimate
  Code 39 start/stop character. Also fixed extend-find-entries-navigate-
  for-new-document-types' eval fixtures, which referenced an undefined
  "Sample Posted Document Header" table/page - declared both.

All claims re-verified against live microsoft/BCApps source. Validators:
frontmatter 0/0, review-fixtures 126/20 domains PASSED, knowledge-index
342/575 PASSED, skill-index 19 leaves PASSED.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-24 21:10:19 +02:00

41 lines
1.7 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()
begin
// WRONG: hand-rolled "encoding" instead of the Barcode
// module's provider/encoder API. This is not wrong merely
// because the delimiter was added by hand - Code 39's own
// symbology does use "*" as its start/stop character
// (Microsoft Learn, "Barcode Fonts with Business Central
// Online"). It's wrong because it's demonstrably mismatched
// with what encoding "No." through the real API would
// produce:
// - it skips ValidateInput, so a "No." value outside Code
// 39's character set, or one that needs a checksum this
// code never applies, reaches the font unvalidated;
// - IDAutomation 1D Provider's own EncodeFont output for
// Code 39 wraps the value in "(" / ")", not literal "*"
// (BCApps' own encoder test: EncodeFont('1234', Code39)
// = '(1234)') - the paired font maps those parentheses to
// the real start/stop glyph, so a string built with
// literal asterisks is simply the wrong characters for
// that font, on top of carrying no real checksum.
BarcodeText := '*' + "No." + '*';
end;
}
}
var
BarcodeText: Text;
}