AnsweredAssumed Answered

Backup script when closing this file problem

Question asked by xtremu on Sep 1, 2011
Latest reply on Sep 7, 2011 by rjlevesque


Backup script when closing this file problem


 I have two tables: Student and AccessLog table, In my AccessLog table i have a global Count Field field so that FM would not increment record each time you close the application. I want FileMaker Pro 11 Advanced backup the current records (all records) in my AccessLog table when you close the application at the end of the day. I have the destination path already for the backup files to save/store and it works good.

Let say first time you close the application, we have 10 records in the backup file. ("BACKUP" = name of backup file), then when you add another 5 records, then close the application it only update/or save the current records (10+5) = 15 records on that the same file or BACKUP file. That's my problem that I can't figure out how to solve this and because Im new in scripting.

(Let say after we have "BACKUP" file in the destination area.)

I want to:

1. Have another file when I close the application containing the current records on the database. (Let say "BACKUP - 1" file in the destination area.), then

2. Clear the records in database of AccessLog table for new records on the next time you open the application/system. The back to number 1, then number 2-loop.

Here's my script:

Set field [AccessLog::Count Field; AccessLog::Count Field + 1]

If [AccessLog::Count Field > 0]

Save a Copy as ["Day"; copy] # Day is the filename of a backpu file save on the designated path

Set Field [AccessLog::Count Field;0]

End If


Please help and thanks in advanced.