DonH Posted September 8, 2003 Posted September 8, 2003 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.
DonH Posted September 8, 2003 Author Posted September 8, 2003 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.
Reed Posted September 8, 2003 Posted September 8, 2003 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.
DonH Posted September 8, 2003 Author Posted September 8, 2003 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.
Reed Posted September 8, 2003 Posted September 8, 2003 sorry about the error in the formula. I didn't realize the less than or equal to character on my mac wouldn't transfer properly
Lee Smith Posted September 8, 2003 Posted September 8, 2003 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 ( in your post instead. The Forum supplied these recently to cover just this problem. Lee
SteveB Posted September 8, 2003 Posted September 8, 2003 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
DonH Posted September 8, 2003 Author Posted September 8, 2003 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?
avida Posted September 9, 2003 Posted September 9, 2003 Steve, How do you accomplished running a script at midnight? Are you using any plugin? CarlosH
DonH Posted September 9, 2003 Author Posted September 9, 2003 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.
kenneth2k1 Posted September 15, 2003 Posted September 15, 2003 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
Riley Waugh Posted September 15, 2003 Posted September 15, 2003 "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)
DonH Posted September 17, 2003 Author Posted September 17, 2003 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?
Anatoli Posted September 17, 2003 Posted September 17, 2003 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.
Anatoli Posted September 17, 2003 Posted September 17, 2003 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.
DonH Posted September 18, 2003 Author Posted September 18, 2003 "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.
avida Posted September 25, 2003 Posted September 25, 2003 Thank you very much for help. I needed this.
Vaughan Posted September 26, 2003 Posted September 26, 2003 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.
DonH Posted September 29, 2003 Author Posted September 29, 2003 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now