Hello, I have a table called Student with CustomerNo and CustomerName as fields from Customer Table. I want that when I update CustomerNo it causes CustomerName to get updated to match the name of the customer with the new CustomerNo. Thank you.
Hello!
two ways:
1. Create CustomerName as flowfield with calcformula Customer.No = CustomerNo
2. Create function in table - RefreshName with code:
IF Cust.GET(CustomerNo) THEN // Cust - record Customer
CustomerName := Cust.Name
ELSE
CustName := '';
Addcode on OnValidate trigger on CustomerNo field in table:
RefreshName;
Hello!
two ways:
1. Create CustomerName as flowfield with calcformula Customer.No = CustomerNo
2. Create function in table - RefreshName with code:
IF Cust.GET(CustomerNo) THEN // Cust - record Customer
CustomerName := Cust.Name
ELSE
CustName := '';
Addcode on OnValidate trigger on CustomerNo field in table:
RefreshName;
Answers
two ways:
1. Create CustomerName as flowfield with calcformula Customer.No = CustomerNo
2. Create function in table - RefreshName with code:
IF Cust.GET(CustomerNo) THEN // Cust - record Customer
CustomerName := Cust.Name
ELSE
CustName := '';
Addcode on OnValidate trigger on CustomerNo field in table:
RefreshName;