error AL0132: 'Record "Purchase Price"' does not contain a definition for 'SystemId'
Hi, i'm trying to compare my Purchase Price record by systemid in an extension and I'm getting this error: error AL0132: 'Record "Purchase Price"' does not contain a definition for 'SystemId'
When I look in the table, this Purchase Price record contains a SytemId when I compile --> no problem but when I publish I'm getting this error.
Am I Comparing the wrong way?

Can you provide a sample that reproduces the issue instead of a screenshot?
Hi
[EventSubscriber(ObjectType::Table, Database::"Purchase Price", 'OnAfterValidateEvent', 'Direct Unit Cost', true, true)]
local procedure OnAfterValidatePurchasePriceUnitCost(var Rec: Record "Purchase Price")
var
PurchasePrice: Record "Purchase Price";
begin
if rec.IsTemporary then
exit;
PurchasePrice.SetRange("Vendor No.", Rec."Vendor No.");
PurchasePrice.SetRange("Item No.", Rec."Item No.");
PurchasePrice.SetRange("Variant Code", Rec."Variant Code");
PurchasePrice.SetFilter("Starting Date", '< %1', Today);
PurchasePrice.SetFilter("Ending Date", '> %1', Today);
if PurchasePrice.FindFirst() then
if PurchasePrice.SystemId = Rec.SystemId then
ChangeLastUnitCost(PurchasePrice."Item No.", Rec."Direct Unit Cost")
else
ChangeLastUnitCost(PurchasePrice."Item No.", PurchasePrice."Direct Unit Cost")
else begin
PurchasePrice.SetFilter("Ending Date", '= %1', 0D);
if PurchasePrice.FindFirst() then
if PurchasePrice.SystemId = Rec.SystemId then
ChangeLastUnitCost(PurchasePrice."Item No.", Rec."Direct Unit Cost")
else
ChangeLastUnitCost(PurchasePrice."Item No.", PurchasePrice."Direct Unit Cost")
end;
end;
I must mention this is on 14.5 BC version
SystemId was introduced in version 15.0. Should we close this issue?
ok, then I will have to find a workaround. sorry for the trouble