Jump to content

Need to Script 337 set field entries


This topic is 6498 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 6498 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.