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.

Monthly Serial

Featured Replies

  • Newbies
Hi Daniele,
 
I'm trying to edit your Custom Function below which i found on the forum (http://fmforums.com/forum/topic/39221-unique-serial-numers), I want to remove the "-" between the serial no. How can I do this?
 
Author: Daniele Raybaudi 
 
Format: MonthlySerial ( AEfield ; digit ) 
 
Result: text 
 
parameters: 
AEfield: text - the text field wich will hold the serial number; it must be setted as auto-enter, always evaluate 
digit: number - the number of digit (#) that must increment by one and restart from one every new month 
 
This custom function can be used for: 
 
1) Autoenter a serial number that increments monthly 
2) the format of the serial number is essentially: YY-MM### 
3) the serial number may have how many digits (#) you choosed 
Hi 
 
The Auto-Enter field must be setted to always evaluate; 
the custom function isn't recursive, so you can use it as a simple calc; 
the custom function will work only with FMP8 and above. 
 
 
05/23/2006 
 
*/ 
Let([ 
year = Right ( "00" & Year ( Get ( CurrentDate ) ); 2 );
month = Right ( "00" & Month ( Get ( CurrentDate ) ); 2 ); 
lastId =GetNthRecord (AEfield; Get ( TotalRecordCount ) - 1); 
lastMonth = Middle ( lastId; 4 ; 2 )    
]; 
year & "-" & month
Case( 
month   ≠   lastMonth  or Right ( lastId ; digit ) = 10^digit -1; Right ( 10^digit  ; digit-1 ) & "1"; 
SerialIncrement ( Right ( lastId ; digit ) ; 1 ) 
)
 
 
Thank you so much.
 

Change this line

year & "-" & month

to put whatever character you want between the year and the month.  If you don't want any separator, make it

year & month

Hi FileMaker Entry Level, welcome to FMForums! :-)

 

I agree completely with Comment … this is one of the biggest traps which befall newer folks to FileMaker.

  • Author
  • Newbies

Hi Doughemi,

 

I tried your suggestion but it didn't work for me. creating the first record is okey, but the getting the next serial is not successful. 

 

 

Thank you.

  • Author
  • Newbies

Thanks LaRetta,  for warm welcome.

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.