Jump to content
Server Maintenance This Week. ×

Using VB to trigger FM8 script on a hosted database?


This topic is 6457 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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!

Link to comment
Share on other sites

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")

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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//

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 6457 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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