Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Resetting a Record Number to 0 every 24 hours

Featured Replies

I have developed a Dispatch program for a small Wheelchair van service. On each record an incident number or run number is assigned to that record. Right now the number goes in sequencel order. What they want is this the record number to reset to 0 at midnight everyday so they can start over with run number 1 unless a trip has been assigned to that day. Here is what I would like to do. Make the runnumber the Julian Date plus the next run number (example 256001...256002...etc). The only thing is they put in trips days ahead or even months (example 12/31/2005 for trip runnumber 365001) so I would need to match the Julain date to the date of service they put in plus the run number in sequencel number. But if the run number is reset everyday at midnight won't that wipe out the run number assigned to the wating call? Hopefully I explained this that everyone can understand.

Edited by Guest

I'd start by trying to talk the client out of this numbering scheme! (Explaining to them how it will add a minimum of 5 days at $1,000 a day often helps.)

Seriously, you will have to store the run number in a prefs file (file or table with just one record) and script the run creation process so that it updates this run number as required.

However managing the advanced entries will be more difficult: in this case you may need to have a table with each record representing a day, and the run number is updated for the particular record. (The new run process would have to first check if a day record alread exists and create on if it does not.)

Things get complicated very quickly.

Problems may occur if new runs are entered around midnight and some computers have un-synchronised clocks: how disasterous would it be if the run number rolled over to the next day at 11:50 instead of 12:00 if the client's computer clock is set 5 minutes early?

FMP 7 would be better here because it has functions that allow date and time to be pulled off the FM server, not each client computer individually.

  • Author

I explained it to them after reading your post and they didn't like the figures so they have aggreed to just do the julian date plus the run number and resetting the run number. Can you explain the script step by step as how to do this?

Thanks

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.