A READER ASKS: Updating Related Record Key Fields

From Dwayne Wright - Certified FileMaker 9 Developer
WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright

I have Master jobs related to the School (Client) database. I have the subjobs based on the master job. I have created a SchoolID field in the SubJob DB, to mirror the SchoolID in the Master Job.

When I create a new Subjob, it will fill in the school ID with the correct value. However, if I go back into the Master record and change the School there, the change will not be reflected in the SubJob(s). What are my options to ensure that the SchoolID field from the SubJobs always stays in sync with the Master?

In a case like this, you might want to script the ability to change the School ID. You can turn the field into a button and attach that to a script. The script would use the
Get (WindowMode) function to detect if the user is in browse or find mode. You need this because in Find mode, you simply want to enter in the field to allow the user to perform a search. In Browse mode however, you would want to use the Show Custom Dialog script step (or a different layout in a new window) to allow the user to enter in the new ID and then click the Submit button.

The key is the Submit button which then does a GTRR command and updates all the related records to the new school ID. The entire process can be ... almost ... transparent to the user.

Here are some links to other posts that might be of interest in regards to this topic...
The Get(WindowMode) Function
Introducing GTRR
EXAMPLE: Go To Related Record (GTRR)
New Windows And The GTRR Command
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2008 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.
====================== ADVERTISEMENT ==============================
Click Here To See The FileMaker Book (via a blog) homepage!