sicSRT8 Posted March 6, 2009 Posted March 6, 2009 Is it possible to run a script on start-up of FM? I am not able to find a script helper.
bcooney Posted March 6, 2009 Posted March 6, 2009 (edited) File>File Options will run a script when the file opens, which isn't exactly the same as when FM opens, but it's what you probably mean. Edited March 6, 2009 by Guest
sicSRT8 Posted March 6, 2009 Author Posted March 6, 2009 Well i have a script set to delete inventory records and import a new list of records to be used in fields on specific layouts to select from. all it does it update the inventory inside FM from an external source controlled by mgnt. When they run in the morning I want it to run automatically so they dont have to mess with it.
bcooney Posted March 6, 2009 Posted March 6, 2009 Is this file hosted by FMS10? If so, you could schedule this script to run whenever the source file is available.
sicSRT8 Posted March 6, 2009 Author Posted March 6, 2009 Wouldnt that mean it would constantly loop all day or just one instance when they start up
bcooney Posted March 6, 2009 Posted March 6, 2009 (edited) Just when the file opens. How is it served? Peer-to-peer, hosted? If hosted, you'd schedule the script to run at a given time you specify. Edited March 6, 2009 by Guest
sicSRT8 Posted March 6, 2009 Author Posted March 6, 2009 Local machine with shared file on local intranet server.
bcooney Posted March 6, 2009 Posted March 6, 2009 (edited) Huh? You shouldn't put a FM file on anything but a FMS or host it from a workstation. Edited March 6, 2009 by Guest
Fitch Posted March 7, 2009 Posted March 7, 2009 As B. pointed out, you should never share a FileMaker file via OS sharing. Only share it using FileMaker's sharing options. That said: What you might do is keep a one-record preferences table with a "last updated" date field. Put this at the top of your import script: If ( dateField = Get( CurrentDate ) ) Exit Script Else Set Field( dateField ; Get( CurrentDate ) ) End If That's not bulletproof but should get the job done. I.e., it will only run once a day. Go to File > File Options and choose the script to run when the file opens. Done.
sicSRT8 Posted March 9, 2009 Author Posted March 9, 2009 The file is only used for reporting and only used by one person at any one time. Right now it works great the way we have it. I can access the file from any computer with FM on it which is all we need. The inventory .xls file is in the same folder and updated another way but need to import daily. RIght now the script works it updates the inventory fields. My only issues is the fields getting updated are the previous records from the previous day. So when originally had 10 and now has 5 the first record shows the 5 not the 10.
Recommended Posts
This topic is 5739 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 accountSign in
Already have an account? Sign in here.
Sign In Now