I want to get the field`s Value using its No I tried using Recref and FieldRef but it keeps giving the old value not the modified one
this is the code:
tableextension 50006 "XEE Customer" extends Customer
{
fields
{
modify(Name)
{
trigger OnAfterValidate()
var
myInt: Integer;
begin
WhenFieldIsModifies(Rec.FieldNo(Name), rec."No.");
end;
}
}
procedure WhenFieldIsModifies(FieldNo: Integer; RecNo: Code[20])
var
MasterCust: Record "XEE Master Customer";
recRF: RecordRef;
fldRef: FieldRef;
Cust: Record customer;
begin
Cust.SetRange("No.", "No.");
if Cust.FindFirst() then begin
// if MasterCust.get(rec."No.") then begin
recRF.OPEN(Cust.RecordId.TableNo, FALSE);
recRF.Get(Cust.RecordId);
recRF.GetTable(Cust);
// recRF.SETTABLE(Cust);
recRF.FINDFIRST;
fldRef := recRF.FIELD(FieldNo);
Message(Format(fldRef));
end;
// end;
end;
}
Can I get the new value onValidate using Recref and FieldRef?