Create a new record in "Contact Management". After entering address and phone, I would like to be able to switch (with a button) to "Patient Info" and have "ContactID" automatically entered into the "PatientID" field. This way the records will be related through the ID field.
The button would say "Add Patient Information" and then would run script similar to:
Set Variable [ $ContactID ; Contact Management::ContactID ]
Go To Layout [ Patients table occurrence ; Patients Data Entry layout ]
New Record Request
Set Field [ PatientID ; $ContactID ]
Go To Field [ ... first field you want to enter patient information on ... ]
But I would suggest that you have an auto-enter serial number in Patients called PatientID and have another field called ContactID and set THAT field with the ContactID variable and not the PatientID. Every table should have a unique auto-enter ID field named the same as its table. It can also be confusing later that you consider a PatientID and ContactID same.
Thanks for your advice; script works great. I tried the set variable and set field steps but I must have had the syntax wrong. And I had not used the "Commit" command before; not sure whether that might have contributed to the problem.
And I appreciate the database design tip with regard to a serialized ID named after the table, and I will implement that going forward.