there are no ideal ways to force the user to click the Update Employees button before trying to select employees
Here, I had two FORM cards showing different fields, with the Button Widget in the middle… so in theory, user will change Company THEN go to Button, click and then reach the part where he must select employee
You can also give warnings.
or
another way is check the company of the selected employee. If it’s different than the company selected, then it shows an ERROR message telling you to click the update button and reselect employee… and it also leaves the employee field in red (conditional formatting)
there is a BIG problem… whenever you re-click the update button, it changes the Employees referenced column leaving empty the rows where current CompanyName doesn´t match Employee company.
So, if I selected AmericanCompany, clicked the button, selected Jessie
Then create a new record, select ItalianCompany, click the button… in the other table, the reference column for Jessie will be empty (because she is AmericanCompany and the CompanyAction column shows ItalianCompany
It doesn´t really erase the record. In fact, you referenced the ID of the row, is just the column it’s looking for the dropdown that is empty.
If you are looking at a table or card list, every row where the previously selected employee doesn´t match the current company after the button was clicked will appear BLANK.
BUT you can have an extra column to show employee name (remember? The reference is to rowid!) instead of the column that changes all the time
what I did here is having a single card widget to create new records… the action button below it and on the right a form card list showing the referenced employee, so you see the employee even if it’s another company after you click the button