How to update a field with a lookup value from another table?
In the image above, I have selected an employee from the Employee table via pop-up.
Now, however, I want to populate the "emp_fk" field in the Tasks table with the Employee's "emp_pk" field from the Employee table (after we selected the Employee name).
I realize this population isn't necessary to have Ninox work correctly, but I'm trying to understand how to do this population for other cases like this.
I was thinking that when the user selects the Employee name from the pop-up (middle field above) from the Employee table, I'd set the emp_fk field above in the Tasks table using a formula something like:
Employee.Task.emp_fk = (select Employee).emp_PK
See below: this "trigger after update" doesn't do anything after the selection.
I also tried to add a where, but could not get that to work or find documentation other then "coming soon" in the documentation...
So, how would I update a field in the tasks table using a lookup from the Employee table after the user selects the employee name?
Thanks,
5 replies
-
By placing a := instead of a =
:= is used to assign a value to a field or variable
= is to compare two values.
-
Now that you learned the trigger method with Steven, another way of doing this would be to make emp_fk a formula field and put this in the formula:
Employee.emp_PK
Now it will be whatever emp_PK is when you select the Employee in the reference field. So now you can call emp_fk in future codes without going to Employee.emp_PK.
Content aside
- Status Answered
- 2 yrs agoLast active
- 5Replies
- 488Views
-
3
Following