Brian Dunning's FileMaker Custom Functions

DailySerial ( AEfield ; digit ; format )

Autoenter a serial number that increments daily

  Average rating: 4.3 (33 votes) Log in to vote

Daniele Raybaudi   Daniele Raybaudi - Show more from this author
ACI
http://www.aci.it

Share on Facebook Share on Twitter

  Sample input:
DailySerial ( id ; 2 ; "" )
DailySerial ( id ; 2 ; 1 )
DailySerial ( id ; 2 ; 2 )
  Sample output:
2005122601
1226200501
2612200501

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

This custom function can be used for:

1) Autoenter a serial number that increments daily
2) the format of the serial number is essentially: YYYYMMDD##
3) the serial number may have how many digits (#) you choosed
4) the format can be specified, so to have:
format = 1: MMDDYYYY##
format = 2: DDMMYYYY##
format = "": YYYYMMDD## <--this is the default result

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.

 

Comments

Jeff   Jeff, Chicago
Jan 7, 2013
This almost worked.

Output record 1: 070120131
Output record 2: 0701201332
Output record 3: 07012013333
Output record 4: 070120133334

Any ideas where this went wrong?
 
Daniele Raybaudi   Daniele Raybaudi, ACI
Jan 7, 2013
How did you enter the function?
IOW, which are the values of your parameters?
 
Jeff   Jeff, Chicago
Jan 8, 2013
AEfield: DailySerial ( Serial Number ; characters ; "" )
digit: 1*
format = ""

* I have since discovered that this was wrong and have changed it to a "2"

Now I am receiving the following:
2013010801
2013010801
2013010801

note that It is not advancing to the next value.
 
Jeff   Jeff, Chicago
Jan 8, 2013
Okay, false alarm and I have re-implemented the custom function and it now works well.

Thank you!
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: