Copy ID from one table to a field in a related table
I am trying to do something that seems really simple, but I have searched and searched and cannot find an any solution that is spelled out step by step, for a real beginner.
- I have a Layout associated with a table, "orders".
- When I create a new record, it automatically assigns a unique Order ID using UUID.
- I have a related table "units". OrderID is related to for_OrderID.
- Each unit record also has a UUID.
- Multiple units can be attached to an order, so I need to link many Units to my Orders table.
- I want to add units through a portal.
- I am not using "allow creation of records" because I do not want the automatic new portal row to be created.
- I need to write a script, tied to a button labeled "Add New Unit to Quote"
- This script needs to go to the units table, create a new record, and put the current Quote ID into the appropriate field in the Units table, then return to where I started.
Copy and Paste will certainly work, but that may cause other issues for the user, so I am trying to avoid.
The other option is to force Filemaker not to create a new portal row when I tab past the first record.
Any help would be most appreciated!