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 serial number

Featured Replies

Greetings!

I have a simple, (for everyone else), but painful (for me) task. As of now, we have our users go to a 3-ring binder behind the front desk to get the information that follows:

When they require the next Invoice number to use, they go to this book, get the number(They are sequential), fill in the "Issued to",

"Job #", and "Date". That's is ALL that this book is used for. They are not invoicing out of it or anything, that is done separately by the Accounting department and application that we use.

Here is where it gets tricky for me. At the beginning of every fiscal year, which is October 1, the Invoice numbers start over, with a new prefix. This allows us to track how many invoices are sent out for that particular year. As of now, we are on Invoice # 07-164, and October 1, the next invoice will be 08-001.

Is there a simple way to do this? My file has 6 fields:

Invoice_Prefix - Right(Year(Get( CurrentDate));2)

Invoice_Number - Invoice_Prefix &"-" & Serial Number

Issued_To

Job_Number

Date

Serial Number - Auto enter serial number.

The prefix symbolizes the year, 07, 08, etc... and the Invoice Number is the sequential field that starts back at 001 at the beginning of the fiscal year. If more information is needed, just ask. I know it's a simple fix on the code, but I'm struggling with it. Too long of a week.

What I have so far works great, but I can't get it to reset the serial number back to 001 on October 1 when our fiscal year changes. Any thoughts or suggestions?

Thanks in advance!

Don Mayes

Copy_of_Invoice_Log.zip

Hi take a look at the links on this thread.

Resetting Serial Numbers

Pay attention to the warnings in all the links.

Also, you may want to change your profile to reflect your curent version of FM. It still says FM6 in your profile. You can change this by going to 'FileMaker Questions' under Your Control Panel, which is located under the My Profile button.

  • Author

Vodka;

I printed them out and read through them, even downloaded the files attached. I see how it's similar to my issue, but I'm not very proficient at the coding aspect and am having trouble with manipulating them to fit me. Is there an easy way to take out year aspect, and insert I guess some code to test for October 20th, and have that switch over. I apologize for the lack of brain waves, but I am trying to learn. Although I did get my profile changed. Thanks!

Donnie

  • Author

Ok Vodka, I have been trying to decipher this code, and I need some help understanding what it's exactly doing. I see the results, and the code, but I can't put them together. It's the AnnualSerial Custom Function code:

Let([

year = Year ( Get ( CurrentDate ) );

lastId =GetNthRecord (AEfield ; Get ( TotalRecordCount ) - 1);

lastYear = Left ( lastId; 4 )

];

year

&

Case(

year ≠ lastYear or Right ( lastId ; digit ) = 10^digit -1; Right ( 10^digit ; digit-1 ) & "1";

SerialIncrement ( Right ( lastId ; digit ) ; 1 )

)

)

Like, I'm not sure why the Power operator is needed and what it's doing, things like that. Help please. lol....

Don

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.