Jump to content

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

Recommended Posts

Posted

I've looked thru the entire book I have and tried everything I can think of, so now I will ask the wizards here.

How do verify data integrity prior to storing it in a db?

One of my biggest headaches right now is that this application will accept any date from year 0001 to 3000. BUT I want to limit it to say 1 year with no later than today.

I see how to make a time frame but not a ROLLING time frame.

Posted

Let me add that I have tried doing the script verification with <= TODAY and that did not work. I still can enter dates greater than today.

Posted

You can set a validation calculation in the Field Definition for the date field.

dateFieldName ? Status(CurrentDate)

something like that should work, where dateFieldName is the name of your date field.

Posted

Well, I finally figured out the problem was I was not putting in the field name.

(DOH)

Anyway, what I finally did was make the calculation like this:

DateField >= Today - 365 AND DateField <= Today

Works great.

Posted

Hey Reed,

That is the way they will look when you paste them in, unless you use the Instant Greamlins in the "Reply To" area by substituting them ( less.gifgreat.gifnotequal.gifpar.gif in your post instead.

The Forum supplied these recently to cover just this problem.

Lee

Posted

You're well advised to replace "Today" with Status(CurrentDate). It's faster, and won't give you a problem if the database remains open past midnight. "Today" does not get refreshed.

Steve

Posted

Okay, I'll change it. Tho I do have a script to shut it down and do a backup everynight just before midnight. Why ask for trouble?

Posted

No. I have a batch file that shuts down the server and then xcopies all the files to the backup location then starts the server and application back up.

The FileMaker book says to just PAUSE the server but I never got that to work so did a shut down. Works fine and it allows for the "TODAY" calculations to be done.

Posted

This reply might be a little late, but Avida911 asked how to run a script at midnight.

Troi makes a plug-in called Activator. In an open solution, this plug-in allows you to schedule scripts to run at certain times.

It's not the easiest plug-in to work, but it gets the job done.

ken

Posted

"Works fine and it allows for the "TODAY" calculations to be done."

It would be best if you never use the TODAY function when developing for FM server. Replace your Today functions with Status(CurrentDate)

Posted

smile.gif That is good advice. If I see the $#@#&$@ who wrote this app, I'll tell him.

Of course I have to wonder why TODAY is in there if it shouldn't be used?

Posted

RE: Of course I have to wonder why TODAY is in there if it shouldn't be used?

Backward compatibility. Since "Status(CurrentDate)" is there frequent remarks and recommendations where made to TODAY being deprecated.

Posted

For larger networks or customer with budget I will not use plugin, but single computer, which is running execution script in Loop.

Then other users on the network add task -- new record -- to be run. The loop checks for any new tasks and if requested running time is empty, it is running the task immediately. If there is time (date) it compares the time and if current time is greater, it executes the task.

This is more reliable, than any plugin. We tried plugins, but if previous task didn't finished, anything can happen.

Posted

"but if previous task didn't finished, anything can happen."

How true. Always know what will happen to the system if something breaks.

I think that was rule #6 of the Programmers Laws way back when.

Posted

Something about the Today function: it's not enough just to stop and start FM Server. The file has to be opened in FMP as the host to recalculate the Today function.

Posted

That's something I learned too. I have changed all TODAY functions over and the whole app starts up much quicker now since it doesn't have to do all the TODAY calculations when it first opens.

This topic is 7796 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.