• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1386
  • Last Modified:

Moving records between tables in Filemaker Pro

I would like to know how to move records between tables in Filemaker Pro Advanced (version 8).  I have one table called "Active Servers" and another called "Retired Hardware" and I would like to create a script in Filemaker Pro to move the current record from "Active Servers" to "Retired Hardware".  Is there an easy way to accomplish this?

Bob Reed
0
esbfern
Asked:
esbfern
  • 4
  • 3
  • 3
  • +2
1 Solution
 
JoJohn2004Commented:
Well, here are a few ways to do this.

 You can islate the record(s) and then import them, though scripts with an import command are a bit sensitive to file naming changes and location.

Depending on how many fields there are in the record, you can make all the fields in the Retired Hardware table lookups. Then you can create a script that makes a new record and then sets a key field (the lookup trigger) to the ID of the Active server. Once it is populated and committed, it will lookup all the other fields automatically.

You can place all the fields in Active Servers on a single layout, then create a script that will go to that layout and use the Copy Record command then paste the contents into a field. The data will all go in one field in a tab delimited format.
0
 
lesouefCommented:
if you prefer the 1st way among JJ's descriptions, you can work around the filename change by using a $variable = get(filename) instead of the real file name to import from as you'll import from the file itself.
If there are only a few fields, a script with the fields used as arguments can also do the job, but not really recommanded as stripping the script arguments is always tricky if you have '-' and '_' in names.
The last method is really ok for 1 single record, otherwise you'll need to loop through records. If you have several to move at once, the 1st method is my prefered. JJ, agreed?
0
 
JoJohn2004Commented:
If I had  to move more than one record at a time, and there were more than a few fields, I would import.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
esbfernAuthor Commented:
There is another wrinkle to this problem that I should mention.  The script to move the record from one table to another (within the same database) would be linked to a button on the Active Servers layout and that would have to work for web connections to this database as it is a web-enabled database on a Filemaker Server.
0
 
lesouefCommented:
thats eliminates the import method as this is not web supported.
you are only left with the 2nd method, as the last one, copy record/paste is not really handy since it does not keep the record structure in the retired table.
0
 
JoJohn2004Commented:
Either that or require  maintenance routines like this to be done locally only.
0
 
lesouefCommented:
btw, why don't you keep the record in the same table and just have a flag "retired"?
0
 
esbfernAuthor Commented:
Yeah, that would clearly be the easiest solution.  But my boss would feel better if the data was purged from the Active Servers table entirely, so I am trying to accomplish that.  I am going to try to use the approach you suggested above and see if it will work with a web-enabled database.  I'll let you know.
0
 
esbfernAuthor Commented:
I finally resolved this issue by doing the following:
1. I added a "To be retired" checkbox field to the Active Servers database.
2. I created a script which does a find of all records that has the "To be retired" field checked, then moves to the "Retired Servers" layout and does an import of the found set in the Active Servers table.  Then jumps back to Active Servers layout and deletes the found set and does a Find All records.  

This solution works but only when using the Filemaker Pro software.  It will not work through a web interface.  It is not a perfect solution, but it does what we need it to do.  

Thanks to both lesouef and JoJohn2004 for their advice.
0
 
lesouefCommented:
refund? bof...
0
 
Computer101Commented:
PAQed with points refunded (500)

Computer101
EE Admin
0
 
BadLTCommented:
you can script this very easily actually... esp. if you're not concerned about iwp restrictions.

I'll post an example script later today.

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 3
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now