Jump to content
Sign in to follow this  
TracieR

Copying a record, vertical tabs

Recommended Posts

Hello all. I assure you once again, I have searched the forum but am not finding anything specific to my problem.

I have an inventory/asset tracking database that I finally got to work the way I had envisioned. I love it, FileMaker is amazing. However, because of the government regulations requiring this new database, I also have a need to archive records when the equipment is taken out of service. We cannot just delete the record.

My supervisor INSISTS that we must handle this the same way we do in our old Access 97 database. He wants my users to be able to click on one button and viola! Archival of the record happens.

I have created a script that does this. I copy the record, switch to the archive layout, create a new record and paste it in. However, the problem is the way the data shows up in the new record. Everything is pasted into the first field, in a vertical tab. The archive layout is a copy of the inventory layout so all of the fields are the same.

How do I get past the vertical tab?

Share this post


Link to post
Share on other sites

Well, copy/paste is not the way to do it. In fact, it is usually not the way to move data in FileMaker, except in special circumstances (Copy All Records, for example).

There are 2 basic methods to move multiple fields at once, Import from the source table to the destination table, or a more complex method of setting the fields via a relationship.

The Import method requires that you isolate the current record, in the current window. Because, if you don't, it will import either the source window's found set, or, if no window of the source is open, all source records. The only absolutely safe way to isolate a record is to set a global to its unique ID (you must have one), Commit Record, then Go To Related Record [ self_global ID relationship; Show only related; current layout ].

[ You could use Show All Records, Omit Record, Show Omitted Only. But it is not 100% safe, because a new record created by another user could sneak in during the split second before Import.]

Now you have only 1 record, you can Import. However, if it is not a lot of fields, I use a slightly more complex method, using a relationship to set the fields, one at a time. The reason is that an error with an Import can Import all the source records. The last thing I need is a phone call from a client, telling me my script just imported 10,000+ records instead of 1. But that's just me, Import is actually fine.

Share this post


Link to post
Share on other sites

Couldn't you just mark the records as archived, and not move them anywhere?

Share this post


Link to post
Share on other sites

The Copy record step copies the data in the fields and then when you paste, it pastes the data ( tab delimited) into the field.

What you are looking for is to copy each field into another table's corresponding fields. You should either use an import script or explicitly set the field.

You can also copy each field's data into separate variables, go to the new layout, create the new record, and then set each of of the new fields with the corresponding variable values.

*Edit: Sorry Fenton didnt see the post.

Edited by Guest

Share this post


Link to post
Share on other sites

Thanks everyone. I used Fenton's advice and was able to get it working.

In response to the question about moving the data: the cyber security regulations we're having to adhere to specify that we must have an archive location, separate from active critical cyber assets. I just love it when the government gets involved. :

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

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