I do this a number of times in my solutions I run a script that finds the records I want to export, exports the data in a .diff format, any format will do except diff keeps the field names for the mapping on the import, and then imports it into the second table. It usually look something like this:
Set Variable [$FilePath; Value; Location of temporary file ]
## Export Records
Go to Layout [ First Table ]
Export Records [No dialog; "$FilePath" ]
## Import Records
Go to Layout [ Second Table ]
Import Record [No dialog; "$FilePath" ; Add ]
And when setting up the script you specify the Field Mapping to either "Matching Names" if they do match, or "Custom Import Order" if they do not.
I hope this helps.
You don't need to export the data before copying it to another table. After you have your found set of records, go to any layout that is based on the target table.
Use the Import Records command to import the records from the source table to this target table. Map only the fields you want to import. You can set the script to leave you at the target table, or return to the original layout.
Thanks guys, both solutions worked.
And can you exlain how can we do that???
I'm having this same problem. But when I go to Import Records, I'm unable to import just my found set. I end up importing all the records from the source table (51 records), regardless of the found set I have open (10 records). What I have noticed is that:
(1) I can only choose the current table as the target if my found set is the predominant window - but that's not the table I want as my target, or
(2) I can choose the correct target table if it's in my predominant window, but then it imports all records instead of the found set, even if the other window is my found set (which I'm sure doesn't matter anyway).
?? I have another file that was developed by someone else that works. I thought everything was set up the same but I don't know where I'm going wrong. Any ideas?
Note: Unless you can use the matching names option. Importing records is dangerous. You have to be very consistant in updating your field mapping each time add remove field definitions in one of the tables. This is a long standing issue with Filemaker.
If you import from a file that is open, you get the file's current found set. Be aware that one data source table can have any number of table occurrences. Each table occurrence can have a completely different found set --so selecting a different table occurrence as your source table will import a diffferent group of records.
If you import from a file that is not open, you get all the records in the table.
I had to replace my Import script step and start again with the correct table occurrence. My old script step was messed up and I couldn't even choose a source table. But it works now that I refreshed it like that. Thanks!!