How can I reset my serial into 1 every beginning of the month?
Sure. Are you on a server, or is this just a local file? If local, then just put this into your opening script.
Create a script to check if the date is the first, then reset the serial, then add a flag to a table to indicate that it's been done for this month. Then have the script run on the server at 1201 every day, or if you're on a local copy, when you initially log in.
Please help me with this script that will reset my serial every month.
"Freeze WindowGo To Layout ["Materials" (Materials)]Show All RecordsGo To Record [Last]If [ Get ( CurrentDate ) = Year (Get (CurrentDate) Set Next Serial Value [Materials:Serial; "1"]End If
Go To Layout [original layout]"
Yes..I am using a server..thanks
That'll make it easier. Just have the server check each morning or when others wouldn't need a reset serial number. That way it'll only update the serial number on the first of each month.
How can I run the script in my filemaker server?
Set up a schedule on the server through the Admin Console. Go to the Schedules tab, and you'll see a list of options, including "FileMaker Script" - that's what you want. Start there, configure to use the script you created, and set it to start at a convenient time and just run it every day. If the date is the first, then it'll run the rest of your script, resetting the value(s) back to 1.
At the very far down What does the "time limit (minutes) for the script schedule mean?
Do I need to unchecked? the default is checked.
That will limit the amount of time the script will try and run. If it's scheduled outside of normal work hours, backups, or other server-side scripts, you should be fine. Yes, I would leave it on, and give it enough time to complete the activity.
You're very welcome. I'm guessing it's all worked out?
Yes, I checked this morning and my serial number field was reset into 1.
Thank you so much!
Wonderful! You're very welcome.
Just so this has been settled and will be available to others, you should probably mark your question as answered.
Retrieving data ...