Jump 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.

Using VB to trigger FM8 script on a hosted database?

Featured Replies

If I try to use the scripts I wrote when I was designing the database locally it wont work now that I have the database hosted on FM8 Server.

Something about the database being open.

How can I trigger a script to import records at a certian time? It used to work, but now that it's hosted VB can't seem to touch it? I'm using the admin login/pass as well to test it... still doesnt have permission.

The database shouldn't have to be closed to import these records in?

Help!

  • Author

error.gif

That's the exact error when I try to run the script from my desktop to a shared folder on the server that contains the hosted files. Do I need to use a FM type path?

Set FMApp = CreateObject("FMPRO.application")

Set FMDocs = FMApp.Documents

'FMApp.Visible = True

Set myOpenFile = FMDocs.Open("F:employees.fp7", "", "")

myOpenFile.DoFMScript ("importPhoneRecords")

Seems to me that I tried to do exactly what you are attempting and I eventually came to the conclusion that it is not possible using VBS.

I accomplish the same thing with the (unconventional for the software world, but convential for Filemaker) method running the script from a startup script in a separate file.

I would prefer to use the VBS method so I'll keep an eye on your post to see if somebody knows for sure.

Here's another thread on the topic where Wim weighed-in. He says *probably* not possible. I consider him an authority on all things Filemaker & Windows.

http://www.fmforums.com/forum/showtopic.php?tid/175391/post/199695/hl//

  • Author

How do I create one of these "opener" files?

Here are the minimum steps:

1. Create a new file that contains no tables at all (i.e. MyFile.fp7). This file will reside on a workstation, not the FM server.

2. In that new file you create only one script (i.e. Startup) that has two lines:

Perform Script [ "The script to be run in the hosted file"]

Close File [ Current File ]

3. Make the script "Startup" run on File Open (File > File Options).

4. Using the Windows Task Scheduler on the workstation, schedule a job that runs MyFile.fp7

That's the bare minimum. You *WILL* want to add a way to abort the startup script and maybe some error checking too.

The downside is that you need to have an extra (maybe) PC available to do this kind of stuff. It would be really great if one could run FM scripts directly from Filemaker Server but sadly it can't be done. Maybe in the next release.

If the file is already open and all you want to do is run a script in it, then you don't need the "Open" command. Just loop through the FM docs collection until you have your file and then run the script.

If the hosted file is not open locally, then you can't open it through a VBscript. FMI took that away with FM7. An opener file is what you need then.

  • Author

All my databases are locked down. So how can I get around the login prompt? Do I have to leave a computer logged in and active on filemaker to get this script to run? Seems like a security issue?

Yes, you need a computer logged on so you can interact with FMP.

Yes, it's a security issue.

Please log it as a feature request here:

http://www.filemaker.com/company/feature_request.html

The more we log it, the better our chances of getting it soon.

  • Author

Yes, you need a computer logged on so you can interact with FMP.

Yes, it's a security issue.

Please log it as a feature request here:

http://www.filemaker.com/company/feature_request.html

The more we log it, the better our chances of getting it soon.

Done!

If you're using FileMaker Server Advanced and if your script contains nothing but web-compatible script steps then you can execute directly on the server through the XML publishing interface...

It's another option.

Create an account or sign in to comment

Important Information

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

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.