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.

serial # that starts over each month

Featured Replies

I have donor numbers (format SC-yy-mm-xxx where xxx is a serial that starts over each month), ex. SC-04-03-087, that are put in a field that is a pop up (in case the referral is NOT a donor). I have automated the first sections of the number but cannot figure out how to make a serial # start over each month with 001. When the user clicks the "Convert to Donor" button, the field is populated with the donor # (except for the last three digits!). If the referral is not a donor, the user clicks in the field and chooses a deferral reason. I guess I can make the user manually enter the last three digits but to cut down on errors, I would rather automate it. Any suggestions?

Version: v5.x

Platform: Windows XP

"Any suggestions?"

You're not going to like my preferred suggestion: forget it. Make the serial number meaningless.

Any other solution will be complex and may allow the possibility of incorrect or duplicate serial numbers being generated, especially in a multi-user environment.

I can think of two methods:

1) The serial number generating script checks the month of the last record in the database and compares it to the current month. If they are different it resets the serial number to whatever is appropriate. You may need to upgrade to FMP 6 or later to get the necessary serial number changing script steps to make this work. You'll also need to make sure that all the user's computer clocks are synchronised, otherwise the serial numbers may be reset at inappropriate times. (It's the last day of the month. A user makes a record at 12:01 am so the serial number will reset to the next month. A few moments later another user whose clock is a few minutes slow makes a record at 11:59 pm so the serial number is reset again back to the previous month starting at 001 which will make duplicate serial numbers. When the next user makes a record the serial number resets again to the next month, so now the first few serial numbers of this month may also be duplicates. There are probably ways to trap for and prevent this from happening, but you can see how the complexity of the system starts to increase dramatically to make it robust and reliable.)

2) At the start of each month the sys-admin manually changes the serial number in the field definition (this solution will work for all version of FMP) They have to remember to do it.

Anna:

I have a client with a similar numbering system - for consistency's sake, when switching over from a paper system, they wanted to keep the system. However, I do NOT use their "serial number" internally in FileMaker (for relationships, etc) - it is just a cosmetic for the user, really.

You can make a self-join based on your yy-mm data, then when creating your "serial number" (remember to always use a REAL serial number for each record as well) you can set the new record's "xxx" value to "Max(your self-join:xxx)+1", then build the serial number as a calculation...

However, there are pitfalls there, no matter what, as Vaughan points out.

-Stanley

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.