12 Replies Latest reply on Aug 15, 2012 11:49 AM by philmodjunk

    How do you auto-generate customized Work Order numbers?

    AmericanPrinting

      Title

      How do you auto-generate customized Work Order numbers?

      Post

      I work in a print shop and we have several different methods of printing. We have different Work Orders for each type. We currently print blank work orders, number them on our machine, and fill them in by hand. We'd like to start printing them out directly from FileMaker Pro once we've entered all the data. The problem is we have a different prefix for each type of printing method. For example, Press numbers start with P-#####, Digital are D-#####, Envelopes are E-##### and so on. Each type of printing has a different set of numbers (Press may start with 50123, Digital may be 10002, and Envelopes amy be 50032).

      So my first question is: how do I set up my database with drop-down prefixes before the number? 

      And my second is: how do I tell the computer what number I want to start with, and make sure it goes sequentially based on the prefix?

        • 1. Re: How do you auto-generate customized Work Order numbers?
          JimMac

          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.

          Jim...

          • 2. Re: How do you auto-generate customized Work Order numbers?
            davidanders

            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.
            https://www.google.com/search?q=serial+number+site%3Aforums.filemaker.com

            • 3. Re: How do you auto-generate customized Work Order numbers?
              philmodjunk

              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.

              • 4. Re: How do you auto-generate customized Work Order numbers?
                JimMac

                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.

                If so...

                I would not use Auto Enter sequence or create new Table of Occurances.

                but instead...

                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..

                 

                Jim..

                • 5. Re: How do you auto-generate customized Work Order numbers?
                  philmodjunk

                  @Jim,

                  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.

                  @American Printing,

                  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.

                  • 6. Re: How do you auto-generate customized Work Order numbers?
                    JimMac

                    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..

                    Commit Record/Request [no dialog]    [release the record for next multi-user]Wink

                    Thanks for that pick up, Phil

                    Jim...

                    • 7. Re: How do you auto-generate customized Work Order numbers?
                      philmodjunk

                      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.

                      • 8. Re: How do you auto-generate customized Work Order numbers?
                        AmericanPrinting

                        @PhilModJunk

                        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!

                        • 9. Re: How do you auto-generate customized Work Order numbers?
                          philmodjunk

                          @American Printing,

                          You seem to have perfectly understood my suggestion.

                          @Jim,

                          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? Wink

                          • 10. Re: How do you auto-generate customized Work Order numbers?
                            AmericanPrinting

                            @PhilModJunk

                            Thanks! I'm framing your post because I finally understood something!

                            • 11. Re: How do you auto-generate customized Work Order numbers?
                              JimMac

                              Yes, I do understand global variablesWink... i was not considering a multi-user evironment, but showing an alternate way for increment the Work Order number as a guide not as a final solution.

                              Globals are really miss named in a multi-user environment and are in fact "local varibles".  I learned that the hard way in 2000Yell!  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.

                              Jim...

                              PS:You still CAN prevent duplication of numbers.Tongue out

                              • 12. Re: How do you auto-generate customized Work Order numbers?
                                philmodjunk

                                Of course you can take steps to prevent duplicate numbers, but if you use a serial number, you don't have to.