Jump to content
Sign in to follow this  
Rich

Auto run script on server

Recommended Posts

Greets, all:

A simple question yet I can't seem to find a definitive answer: I want to have a script automatically run (in a hosted file on FM Server 18) on the last day of every semester that will create a report (which will be further scripted to be sent by e-mail to multiple users). What do I need to code/set up so the script will run autonomously?

TIA for your replies!

Share this post


Link to post
Share on other sites

If semesters end on the same day each year you can probably setup different scheduled scripts for each semester and repeat these schedules every year.

Alternatively, if there's no rhyme or reason to the ending of semesters, create a schedule that runs every day (or if semesters always ends on a Friday, run it every Friday), and then use a table to manually register the end of semesters. Then execute the script if the current date matches a date in the table.

Share this post


Link to post
Share on other sites

Yes, that's later on, but how do I intitiate the auto-run of the script? Does Perform on Server automatically track the date/time while the file is sitting idle on FM Server?

Share this post


Link to post
Share on other sites

You initiate the run of a script in the scheduler on the server. You specify a date and time when to run a script. You can run a script once or repeat it every day, every hour, etc.

In the script you can then check the current date and time to determine whether it's a last semester day. 

I'm not sure I understand your question about PSOS. A PSOS script is triggered from a client. Not from the server. You can't run the PSOS script command on the server. 

  • Like 1

Share this post


Link to post
Share on other sites

https://www.youtube.com/watch?v=94HVrQblPcc

DB Services shows different ways to generate a PDF and email. I reference this video because it shows at the end how his report script is called by a server script schedule which is what you want to do. You'd need to add to your report script the logic to see if it's the last day of a semester. As Olger mentioned, this can be a query to a table that has a record for each last day of semester. 

Also see: https://fmhelp.filemaker.com/help/18/fmp/en/#page/FMP_Help%2Frunning-scripts-on-server.html

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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