April 8, 200421 yr Is there a quicker way to write a script to enter field values from a related file without doing a set field command for each field? I have three different tables to pull from, but I need to have a button scripted to fill in all of the values in the base table. FileMaker Version: 6 Platform: Mac OS X Panther
April 8, 200421 yr Author I do not need to add a new record, just edit the one that I have. Can I use the lookup within a script?
April 8, 200421 yr Yes. Make each field you want to get updated a lookup field. Then in the script do a Relookup Contents [No Dialog, <Key Field>] script step. Do this for each key field that your lookups are based on. Just remember, this will replace the contents for all those lookup fields with the related value. But if the related value is empty, the field contents will not change.
April 8, 200421 yr Author So there would be the same amount of steps in the script that there would be if I did a set field?
April 8, 200421 yr The Relookup Contents script step is done for each "key" field, as in "relationship key". So if a bunch of fields in Table1 need data from Table2, and they are related by Table1 ID=::Table2 ID, just do the Relookup on Table1 ID. FileMaker Version: Dev 6 Platform: Mac OS X Panther
April 8, 200421 yr Author Can you offer any help in how to script the import? What I tried did not bring the information in.
April 8, 200421 yr In the import dialog, select "Update matching records." Match up the fields on the left and right and set the key fields (i.e., the ones that need to "match"). Perform the import. Now create a script with Import Records (Restore). You can only store one import order in a script, so you'll need to create a separate import script for each file, then you can call all of them from one master script using the Perform Script step.
April 9, 200421 yr Author I appreciate the help. The problem I seem to have is that I need to update areas in the current record, not make a new record. Everything has been creating a new record with the import. I just need to pull a whole lot of field information to the current record from a master record.
April 9, 200421 yr Hi, The Import would let you choose between several options : 1. Create New Records 2. Substitute datas 3. "Synch" Data FileMaker Version: 6 Platform: Mac OS 9
April 9, 200421 yr pmkprog: As Ugo points out, what you want is to "Update" records - you even have the choice of whether you want new records created if there are records in the originating file which have no match in the importing file... -Stanley
April 9, 200421 yr Author Thank you very much. I finally got the script to work. I needed to be in one record only by performing a find first, then I had no problems.
Create an account or sign in to comment