Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 4085 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted
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.
 
Posted

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
Posted

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.

This topic is 4085 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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