Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I have a database with mulitple tables. With one button I want to transfer a record from one table to another. Is there a way to do this other than copy and pasting into every field?

Heathbo

Posted

I already have identical fields in both tables and layouts. Essentially I need to get record A in table 1 into table 2. Since the fields are identical in both tables it shouldn't be any problem, right? I guess if no one knows of a way to do this I could always use a script to copy from the fields in table 1 and paste to the fields in table 2. I just thought there might be an easier way.

Posted

I can do that if I want to import the whole database. What if I wanted to just import one record? For example: In table 1 there is a button on the record you are looking at. When you push that button only the record you are looking at is imported into table 2. Is there a way to narrow down what records are imported with the import command?

Posted

Maybe what you could do is create a unique identifier (lets call it ID). In the first table

Create a script which copies the current ID; enters find mode, searches for current id then exports to a pre-specified filename, then moves to the appropriate table and imports that same record. As you've saved it as a pre-defined filename it should be no problem. You will have to do 1 of 2 things.

either export the file temporarily to the user's c: or use a plugin to export the file to say a name which equals the field i.e record 12940 gets exported as 12940.tab etc

Posted

Many years ago I faced the same problem and solved it exactly the same way.

1) Segregate out the record you are interested in by copying a unique id and Finding that id.

2) Export the new found set (of your one record.)

3) Import into the other table.

Works great

Posted

Am I missing something here? Has V7 changed the way import works?

Import only imports the found set so to import a particular record, you just find it in the 'remote' file and then import.

Perform Script [external- other file, "FindIt"]

Import [Restore, Add Records]

Posted

Thanks all. I got it working. What I did is I added an ID number to each record. Then did the find. Filemaker 7 now allows you to import records into another table without having to export the record to a seperate file. So this worked out perfectly.

Thanks again

Posted

However, it's not mulit-user safe. Better to use a self-relation and go to the related record.

Posted

two things:

1) as a matter of practice you should have a unique id field in every table you create

2) i think it's cleaner to do a set-field than a copy-paste. set a global number field with the unique id, enter find mode, set the unique id field with the global number value, and perform the find. this way, if the user has something in the clipboard it isn't lost, and your programming is transparent to the user.

btw, brucer's method above is another good way to do this.

Posted

It has never been safe to do this - though the risk is probably small. If a new record is created with the right timing by another user while your script is running, you will end up with the new record in your "single record" found set. If you go to related record by record ID, that is the only record you will get, period. This point comes up regularly in other lists.

Posted

Filemaker 7 now allows you to import records into another table without having to export the record to a seperate file.

For future reference, would someone mind filling me in on how one would perform this task? Thanks! smile.gif

  • 3 weeks later...
Posted

You use the import records/ file fuction. Then select the record your using. Then you just specify wich table data is going into which table.

This topic is 7403 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
×
×
  • Create New...

Important Information

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