October 29, 200124 yr I'd like to write a script that generates an alpha numeric serial number that is only one higher than the last record. When I use the auto enter function from The "define fields" dialog box, new records show the next absolute serial number (from some library I suppose), not one higher than the last record. Help, and thanks
October 29, 200124 yr The Auto-Enter Serial Number will increment to the next number. You can have alpha characters, such as 'quote1' and the Auto-Enter will create 'quote2' for the next record. Hope this helps. Garry
October 29, 200124 yr Author Garry, Thanks, but my problem is that I am trying to write a script in my main file that will go to a number generator file, create a new record-serial number, and return to the main file and paste it into a serial number field, IF it is empty. ELSE, execute a sub-script that deletes the number generator file record containing the new serial number. That works fine, but when I execute the script that goes back to the number generator, the next new record gets a serial number that ignores the fact that I deleted the previous record, and gives what should have been the next value, had I not deleted the record.
October 29, 200124 yr In FMP 5.5 there is a script step that can reset the "next value" for the serial number. This'll do what you want. On the other hand, why not reverse the process: only run the script if the serial number field is empty. That saves creating/deleting the record in the first place, and the solution will work with any version.
Create an account or sign in to comment