Is your file hosted on FileMaker Server?
If the answer to the first question is no, will you leave your database open all day/night?
FileMaker Pro by itself won't do anything unless its open. FileMaker Server will run server-side scripts that can do a task to your database at exactly midnight.
If you answered yes to the 2nd question, then we can find a solution. We can attach an ontimer script to a layout to check for the current time and to do something if the time is midnight at that moment. Its not very elegant, I think, but it could work.
Hello Jeremy, Thanks for your answer and the file will be running 24/7 on a stand alone computer ( for now).
IN that case,
I'd do the following:
1. Create a layout that will be open over night.
2. Put a button on there called "Turn on Timer".
3. Create one script called "InstallTimer"
In that script, use the Install On Timer script step. Choose the script you want to run ("Do Something") and then put in the interval in seconds. (This "InstallTimer" script will run every x seconds.
4. In the script you want to run, "Do Something", add the following script steps to the beginning:
if [ Get(CurrentTime) < Time (0;0;0) ]
Exit Script 
This will evaluate the current time that the INstallTimer script runs and it will exit if it is less than midnight.
(Honestly I haven't tested this, but I think it will work. Others can help me out if this calc is incorrect: the Time (0;0;0) part.
At the end of this Do Something script put a "close application" script step, or close this layout. OR do an Install On Timer Script step again. This time, don't choose a script and put in 0 for the interval. BE SURE to do one of these, otherwise the Install on Timer script will keep running over and over.
At night, I'd bring up this layout and press "Turn On Timer" to get it started (or you can bypass the button al together and put in a onLayoutenter script trigger).
Jeremy I did tested but does not work and I need to request new record automatically at minight
Hi. In my description I used a script called "Do Something". You want to replace that with your new-record script.
So your layout should be on the Table occurrence that the new record will be created in.
Everything else should work fine. See attached sample file.
I changed the If statement to look for Time (23;59;59)
Hello Jeremy I have downloaded the file, but no access to layouts or scripts