kauakea
asked on
daily trigger via script
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
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
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
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
ASKER
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
an example would be great as i dont understand the concept of self relationship
thanks
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.
Hope this solves the problem, I can provide an example if you need it.
I think it c
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
works great
ASKER