Update a field in the master record from a window handling a related record
I have the following situation:
tbl_customer::ID --> tbl_addresses::ID_customer
tbl_addresses::ID --> tbl_customer::ID_address
I have a layout that shows customer details and details of the current address. It has a button that calls a script to add a new address in a modal window. It passes tbl_customer::ID as a parameter. The script puts the parameter value in tbl_addresses:ID_customer and is supposed to put tbl_addresses::ID as a feedback into the field tbl_customer::ID_address.
The script works fine except that the last step which is to update tbl_customer::ID_ddress doesn't work, presumably because the current record is the new address record and that prevents the update of the customer record.
I tried SETFIELD and SETFIELD BY NAME to accomplish the task but to no avail. The field tbl_customer::ID_address remains what it was before the script ran.
I would be most grateful if someone could point me to a solution for this problem.