Relookups And Alternate Methods

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

The Relookup Contents Script Step is used to replace information in lookup fields with the current related information for all the records in the current found set. Much like entering information in a key field triggers any associate lookup commands, the relookup will do the same thing, except it will do it for all the records in the current found set.

Sometimes, a relookup can be a very bad idea because it will replace all the contents for all fields using that lookup setting for all records in the found set.

In a case where I want the latest related data in a particular field for a found set of records, I tend to use the REPLACE command with a calculated result equal to the related data. In a case where I want the latest related data in a particular field for just one record, I tend to use the SET script step with a calculated result equal to the related data.

In this example, we have the city and state fields set up as lookup values. When a zip code is entered in, the city and state information is automatically copied over. Click the step 1 button to set the city and state information to text values. Click the step 2 button to see how the relookup command sets the city and state values to their related data via a relookup.

Click the step 1 button again to set the city and state information to text values. Now click the Alternate Step 3 button and you will see the test data was only changed for the current record. This was done by using the SET script step.

Click the step 1 button again to set the city and state information to text values. Now click the Alternate Step 4 button and you will see the test data was only changed for the City field for all records in the found set. The State field is unchanged. This was done by using the Replace Field Contents script step.

An example file can be downloaded by clicking (here)

© 2010 - 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.