Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Run Script on Start

Featured Replies

Is it possible to run a script on start-up of FM? I am not able to find a script helper.

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 by Guest

  • Author

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.

Is this file hosted by FMS10? If so, you could schedule this script to run whenever the source file is available.

  • Author

Wouldnt that mean it would constantly loop all day or just one instance when they start up

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 by Guest

  • Author

Local machine with shared file on local intranet server.

Huh? You shouldn't put a FM file on anything but a FMS or host it from a workstation.

Edited by Guest

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.

  • Author

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.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.