6 Replies Latest reply on Apr 10, 2009 1:07 PM by pickler

    Serial Numbers



      Serial Numbers


      The serial number I am using is in a number and text format.   22N3D3333 (job number)


      I have made a script that writes the job number from the last record to a global field. 


      The next new record sets the job number field with the global field and adds a 1.


      This seems to work until I noticed the text was being omitted.


      Any ideas



        • 1. Re: Serial Numbers

          Hi pickler


          do not add, but use the SerialIncrement function.

          • 2. Re: Serial Numbers

            Brilliant.... Job done


            Thanks for your help 

            • 3. Re: Serial Numbers

              pickler wrote:
              I have made a script that writes the job number from the last record to a global field.

              This doesn't seem to be a reliable method. Why don't you set the field to auto-enter a serial number?

              • 4. Re: Serial Numbers

                Thanks for the input.


                What I finally ended up doing was using a global field to set the users job number.


                On a new record, the global field gets entered into a "Job" field.


                A script then sets the Job field using the SerialIncrement and adds 1 to the value. 


                Then the global field gets set to the new job number.


                It appears to be working fine. 

                • 5. Re: Serial Numbers
                     I am not getting where exactly is the previous number coming from, but you need to consider what happens when the last record is not the current record (perhaps not even in the current found set), or when a record is deleted, or when two users are creating a new record at the same time, and so on.
                  • 6. Re: Serial Numbers

                    I have a layout that has the user fill in pertinent information. All that data gets set in Global fields. eg. One field is  "Select a number to use for your report" The user enters 22ght01 This gets set to the Global field "job"


                    When the user starts a new record, a script runs and takes the global field "job" and adds 1. with the SerialIncrement function.


                    This value is then set into a field called "job number"


                    The field "job number" then replaces the global field. So, when the user enters another job the global field is used + 1 


                    It all seems to work just fine.


                    This is a single user application, so no worries with multi users.