2 Replies Latest reply on Mar 24, 2011 10:34 AM by pinoy

    Serial Number Based on Month Then Start Over

    pinoy

      Title

      Serial Number Based on Month Then Start Over

      Post

      Hi,

      What im trying to achieve is have a serial number auto count in increments of one for each new entry. But when then entries start on a new month i would like the auto count to start back at 1.

      I have a field for the serial number, date, and just the month name and other data.

      Any help and or suggestions would be greatly appreciated.

        • 1. Re: Serial Number Based on Month Then Start Over
          philmodjunk

          You can write a script that uses Set Next Serial Value to set the serial number field back to zero.

          The script can be set to run when the file is opened, opened by a specific user (such as the host), or if this file is hosted from FileMaker Server, the script can be run from a server schedule set to run the script once a day.

          The script will need additional steps that keep this from taking place more than once a month. On a server scheduled script, the script can simply check the day of the month of the current date and exit without doing anything when the day of the month isn't 1. For other scripts, you'd need to log the date this update last took place in a table set up to log the updates. If the most recent date is for a different month than today's date, your script resets the serial number field.

          • 2. Re: Serial Number Based on Month Then Start Over
            pinoy

            Thank you so much for the advise. That definitely sounds like it will solve the problem and do what i need it to do it my scenario. I will let you know how it goes. Thanks!