January 18, 201213 yr Newbies 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.
January 18, 201213 yr 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 )
January 18, 201213 yr Author Newbies 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
Create an account or sign in to comment