Does anyone know why 'No.' cannot be recognized by my code? In table sales line, No. is the name of the field for Item No.
pageextension 50124 "Sales Order Subform Ext" extends "Sales Order Subform"
{
layout
{
addafter("Description")
{
// This field is on Sales Line (from my "Sales Line Ext")
field("Four Digit"; Rec."Four Digit")
{
ApplicationArea = All;
trigger OnValidate()
var
itemRef: Record "Item Reference";
begin
// Filter Item Reference by the same 4-digit code
itemRef.SetFilter("Four Digit", Rec."Four Digit");
if itemRef.FindFirst() then
"No." := itemRef."Item No."
else
Error('No matching reference for "%1".', Rec."Four Digit");
end;
}
}
}
}