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

    Serial Numbers

    pickler

      Title

      Serial Numbers

      Post

      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

       

      Dave 

        • 1. Re: Serial Numbers
          raybaudi
            

          Hi pickler

           

          do not add, but use the SerialIncrement function.

          • 2. Re: Serial Numbers
            pickler
              

            Brilliant.... Job done

             

            Thanks for your help 

            • 3. Re: Serial Numbers
              comment_1
                

              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
                pickler
                  

                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
                  comment_1
                     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
                    pickler
                      

                    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.

                     

                    Thanks

                     

                    Dave