Solved

daily trigger via script

Posted on 2006-11-30
8
280 Views
Last Modified: 2010-04-27
i am running fm 8 server with 4 workstations running 8.5 on xp.

i want to add a daily routine to my startup script. but i only want it run once by the first person to login.

i have custom function cdate with the value Get ( CurrentDate )
i have a global field in table homeowner "date printed"
my script looks like this:
if[cdate ≠ homeowner::Date Printed]
     set field [homeowner::date printed; cdate]
and then i run my routine.

it worked fine as standalone for me.  but now that i am running the database on the server i am getting inconsistent dates in the global field "date printed"
it sets the date ok with the set field command, but then when i exit the program and come back in, "date printed" is either empty or it has a different date so the routine runs every time someone logs in

thank
0
Comment
Question by:kauakea
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 

Author Comment

by:kauakea
ID: 18050847
can you run a script from the server at a predetermined time??
0
 
LVL 28

Expert Comment

by:lesouef
ID: 18052126
if the cdate gets deleted, it's because it is a global field I guess. they are nto saved in a multi_user usage since they are local to each client.
if you want to keep a value relevant of the user, then you need a table of users where you store this.
and
you can run scripts on the server, but shell scripts, not filemaker scripts. what do you want to achieve, keep the date the user printed something for the last time?
create a table with 3 fields, username, date and current user (global this one); make a self relationship in between currentuser and username, and use this relationship::date to store your cdate.
tell me if this is what you need and if you'd need an example
0
 

Author Comment

by:kauakea
ID: 18052174
i do want to keep the date that a specific user printed something and then test it in the startup screen against the current date and if the two are not the same i want to print the reports and then set the printed date so that if she exits and relogs in on the same day it wont print a second time.
an example would be great as i dont understand the concept of self relationship
thanks
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Expert Comment

by:jvaldes
ID: 18052263
The challenge is that Filemaker has only local globals so the person logging in and out will reset their global table and other users will not be able to reset their globals. The approach I have used for a different application is I created a different database in your case the "LastPrinted" database where you would create one record for each user and stor ethe last printed date in that location. Write a script in he dtatbase that will search to see if your username already has a record if so update compare it to today "//" if different apply the new date and run your routine.

Hope this solves the problem, I can provide an example if you need it.

 
0
 
LVL 28

Expert Comment

by:lesouef
ID: 18052374
I think it c
0
 
LVL 28

Accepted Solution

by:
lesouef earned 500 total points
ID: 18052395
I think it can be simpler if you just want to track if reports have been printed today or not, regardless of who did it.
create a printlog table where you simply store the date and the printed flag. If you want to keep a log, create a record/day, if not, always re-use the same record for the current day, I'll make an example of the latter first, let me know if you'd need the other case
0
 
LVL 28

Expert Comment

by:lesouef
ID: 18052432
0
 

Author Comment

by:kauakea
ID: 18056236
works great
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question