pmkprog Posted April 8, 2004 Posted April 8, 2004 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
pmkprog Posted April 8, 2004 Author Posted April 8, 2004 I do not need to add a new record, just edit the one that I have. Can I use the lookup within a script?
Ender Posted April 8, 2004 Posted April 8, 2004 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.
pmkprog Posted April 8, 2004 Author Posted April 8, 2004 So there would be the same amount of steps in the script that there would be if I did a set field?
Ugo DI LUCA Posted April 8, 2004 Posted April 8, 2004 An import rather than lookup IMO. FileMaker Version: 6 Platform: Mac OS 9
Ender Posted April 8, 2004 Posted April 8, 2004 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
pmkprog Posted April 8, 2004 Author Posted April 8, 2004 Can you offer any help in how to script the import? What I tried did not bring the information in.
Fitch Posted April 8, 2004 Posted April 8, 2004 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.
pmkprog Posted April 9, 2004 Author Posted April 9, 2004 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.
Ugo DI LUCA Posted April 9, 2004 Posted April 9, 2004 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
stanley Posted April 9, 2004 Posted April 9, 2004 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
pmkprog Posted April 9, 2004 Author Posted April 9, 2004 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.
Recommended Posts
This topic is 7536 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now