FMP will sequence [unique] even text numbers like P-#####. Define your text field as Auto enter sequence starting with ... say P-00001 and increment by 1 if you wish.
Each of your deferent prefixes must be different fields or Work order Types Like PressNumber and DigitalNumber and EnvelopeNumber... each with is own sequence. No need for dropdown if you know which printing type you need, just select the appropriate number to print.
You have three or more serial numbers that can be auto entered, unique, not modifiable - PSerialID, DSerialID, ESerialID and so on.
The problem is if you put them all in your Work Order Table, each would increment by one in each new record.
Seems to suggest that there would be a separate Table for each type of serial number.
A button or field on the Work Order would specify the type of Job, create a new record in Digital Serial Table or Press or Envelope, set the Job serial number to that Digital Serial Number (and have the field set to be not modifiable).
Serial numbers can be auto entered, contain letter prefixes (and suffixes), just be sure to pad the number with enough zeros to hold however many number of years worth.
Manage > Fields > Options is where this is set up with the next serial number or changed.
I am a technician and not a Filemaker Wizard, this may not be optimal, but if there is a better way, I sure someone will have it.
A Google "serial number site:forums.filemaker.com" of the posts on these forums.
You can also use a calculation field that merges your text with your serial number.
Define a serial number field, __pkWOID
Define a text field, WOType for the Letter designating the WO type.
Then a calculation field can use an expression such as:
WOTYPE & Right ( "000000" & __pkWOID ; 7 )
Note, if that works for you, use __pkWOID as your primary key to link to other tables, not the calculation field.
American Printing, I don't normally argue with Phil or David, who are both masters of FMP use, but I read you post again.
It seems that you want to do a single standard Work Order Form with only the sequened serial number based on your 3 types as a variable.
I would not use Auto Enter sequence or create new Table of Occurances.
Create a Text field name say... WOType and display as a Radio button control... from a List of ... Press Digial Envelope
Create 3 numeric global fields for your separate sequence counters. Say... gPress gDigital, gEnvelope [independent of record creation]
Create a button that uses Show Custom Dialog using the 3 global fields above as input fields for intial values or changing as needed.
Create a text field Sequence for your Standard Work Order Form... on say print layout "PrintWO"
Create a "Print" button to perform the following Script "Print Work Order" below..
Your method can produce duplicate WO numbers if you host the database over a network and two different users try to create work orders at the same time.
Can you clarify whether you want a single sequence of numbers shared by all WO types or do you need a separate sequence for each type of Work Order?
A single sequence will be much easier to manage in your database if you can get that to work with your shop's work flow.
To prevent multi-users who might hit the Print button at the same time..
Add to then script after Go to Layout step
GotoField Sequence and select/perform [holds that record to prevent duplicate Sequence numbers]
And at the end of script add..
Thanks for that pick up, Phil
I don't think that will prevent duplicates. The users can be on different records.
And no extra work is needed to guard against duplicates if you use an auto-entered serial number to generate the numeric portion of the WO number. The only issue is whether you need a separate series for each type of work order or a single series where the text portion of the WO number varies to identify the type.
We are currently using different sequences based on Work Order Type. We are actually wanting to increase the different types of work Orders to 8 (rather than the 3 we have now), which will make it easier for us to track things.
I don't think I have a problem changing to a universal sequencing if that will make things easier. I assume that if that's the case, all I have to do to differentiate between the various types is have a drop-down list in front of the number to choose which prefix I want. Since the actual Work Order number won't be duplicated down the road by a different type, I would only need one number field. Right?
I appreciate everyone's help, but I'm an absolute novice at this so some of the tips have been over my head. I've only ever used an existing database, so starting from scratch has been an education! Thanks again, and all help is truly welcome!
You seem to have perfectly understood my suggestion.
Thought of another issue after I posted: Did you realize that if you have two users running your script on a networked file, the changes made to the global field by each user neither persist nor are visible to other users?
Thanks! I'm framing your post because I finally understood something!
Globals are really miss named in a multi-user environment and are in fact "local varibles". I learned that the hard way in 2000! I simply created a single record TO and used its layout as a master navigational page and placed the single user "Globals" there. Which is kinda like you suggested.
I should have known better than jump in, before testing the water, but mine will still work in single environment or do what i did in 2000 with the true globals.
Of course you can take steps to prevent duplicate numbers, but if you use a serial number, you don't have to.