September 8, 200322 yr 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.
September 8, 200322 yr Author 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.
September 8, 200322 yr 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.
September 8, 200322 yr Author 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.
September 8, 200322 yr 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
September 8, 200322 yr 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
September 8, 200322 yr 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
September 8, 200322 yr Author 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?
September 9, 200322 yr Steve, How do you accomplished running a script at midnight? Are you using any plugin? CarlosH
September 9, 200322 yr Author 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.
September 15, 200322 yr 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
September 15, 200322 yr "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)
September 17, 200322 yr Author 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?
September 17, 200322 yr 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.
September 17, 200322 yr 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.
September 18, 200322 yr Author "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.
September 26, 200322 yr 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.
September 29, 200322 yr Author 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.
Create an account or sign in to comment