In this example, we are showing how a file can automatically quit a determined number of days after the file was first opened. This method assumes the solution is a single user solution and not networked. This is the common setup when you deliver a demo of a product and you want to set a date when it expires.
I did not wire up the time bomb script as the startup script for this example. In normal practice, you would. I just didn’t want to bewilder users with a time bomb on an example file. So I added a button to test the script. So you can experiment with different settings and click the test button. By all means, you will not want to allow users to see or edit the key fields for the operation. I do that here for example purposes.
The actual startup script will see if the Date First Opened field has data. If it doesn’t, it adds the current date into the field and stops the rest of the script. If the Date First Opened field does have data, it evaluates if the Turn Off Date is less than the current date. If so, it closes the file after showing you a message.
Although the method in this example would not work in a hosted environment, it would take a few tweaks to make it that way. In a case like this, you would probably want the time bomb to be linked to a user account. You would like use a user account table to determine the date first opened and refer to it via a relationship.
An example file can be downloaded by clicking (here)
More info about the author and FileMaker in general, contact me at email@example.com.
© 2010 - Dwayne Wright - dwaynewright.com
The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc