Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

  • Newbies
Posted

Hi,

I am a beginner filemaker user and I use FMP 11 Adv. I have a problem using script to generate serial number. I am required to generate a serial number with this format: YYYYX-PPPPPPP-AA ,

YYYY is the year

X is the month code, the code for example:

Jan-Mar = A

Apr-Jun = B

Jul-Sep = C

Oct-Dec = D

PPPPPPP is the project number

AA is the number of the time the invoice is created, starting from 01

How can I implement this requirement?

Thank you very much for your help.

Posted

provide this serial number is for user side information and not relied on for a matching key value in a relationship I would say this will work:

Let ( [

ts = Get ( CurrentHostTimestamp ) ;

yyyy = Year ( ts ) ;

m = Month ( ts ) ;

x = Case ( m ≤ 3 ; "A" ; m ≤ 6 ; "B" ; m ≤ 9 ; "C" ; m ≤ 12 ; "D" ) ;

aa = Right ( "00" & hour ( ts ) ; 2 )

];

yyyy & x & ProjectNumber & aa

)

  • Newbies
Posted

Yes, the serial number is for user side only, where do I have to specify this script? Do I have to create another field for this serial number? and why did you put aa = Right ( "00" & hour (ts) ; 2) ?

thanks

This topic is 4693 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.