March 17, 200619 yr Hi Folks - this forum is just sooooo helpful! Thanks to a fussy bookeeper, I have a new problem with automating serial numbers for invoicing. This current calculation: [color:red]( If ( Month ( Sale Date) < 10 ; "0" ) & Month ( Sale Date) & Right ( Year ( Sale Date) ; 2 ) & newSerial# Invoice) returns: 03060000 03060001 03060002 03060003 etc… with each new record. However - now I need to figure out how to automatically reset [color:red]"newSerial# Invoice" back to [color:red]"0000" at the start of each new month. Any ideas out there?
March 17, 200619 yr Not quite the correct Forum for this question.... FMP 5.5 and later have "Set Next Serial Number" script step. Thi'd be ideal for you because it saves having to go into Define Fields to change the serial number entry. Not sure if it's in FMP 5 though.
March 17, 200619 yr As Vaughan mentioned, you can use the "Set Next Serial Number" script step. Also you can set the script to run automatically when your solution is opened. You'll need to keep track of when the serial numbers where last reset - in your case it seems like its incorporated into the serial number itself - but you could also store this information in global month and year fields. With a calculation you the script can test if this is the start of a new month/year and if so then reset the Serial Numbers.
March 17, 200619 yr Here is one attachment for you. You must think about two questions: 1.Can you delete invoice for last time? 2.Can you change the date of invoice to other month? Inv_Num.zip
March 17, 200619 yr "...you could also store this information in global month and year fields" Global fields will break in multi-user. Instead, create a "prefs" table with a single record to store the values in "normal" fields.
March 22, 200619 yr Author "...you could also store this information in global month and year fields" Global fields will break in multi-user. Instead, create a "prefs" table with a single record to store the values in "normal" fields. Hi Vaughn - thanks for your reply - but I didn't really understand it. I haven't workied much with global fields. Could you go into a little more detail in relation to the fields i have described? thankx }:(
March 24, 200619 yr Author Here is one attachment for you. You must think about two questions: 1.Can you delete invoice for last time? 2.Can you change the date of invoice to other month? Thanks AAA! Your solution was a tremendous help. And thanks to everyone else for your suggestions. You are all just sooo great
Create an account or sign in to comment