I've created a custom table with 2 fields - One is a lookup to the Customers table, the other is a FlowField that displays the name of the customer selected in first field.
field(18; Customer; Code[20])
{
DataClassification = ToBeClassified;
Caption = 'Customer No.';
TableRelation = Customer."No.";
}
field(19; CustomerName; Text[250])
{
Caption = 'Customer';
FieldClass = FlowField;
CalcFormula = lookup(Customer.Name where("No." = field(Customer)));
}
Both fields work correctly, however I'm noticing that if I change the Customer No selected in the first field, the second field doesn't display an updated name until I close and reopen the record.
My question is how can I update the Customer Name field every time the Customer No. is changed, without having to reopen the page? I'm assuming I should utilize the OnModify function but can't quite figure it out.
Thanks!