Newbies octopuz Posted January 18, 2012 Newbies Posted January 18, 2012 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.
Ocean West Posted January 18, 2012 Posted January 18, 2012 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 octopuz Posted January 18, 2012 Author Newbies Posted January 18, 2012 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
Newbies octopuz Posted January 18, 2012 Author Newbies Posted January 18, 2012 okay, I've already figured it out. Thanks for your info :)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now