3 Replies Latest reply on Sep 24, 2011 2:31 AM by Sorbsbuster

    Auto-Serial - Can it be account name dependent?

    mauigirl

      Title

      Auto-Serial - Can it be account name dependent?

      Post

      We will have two users creating invoices on the same database. Sometimes, at the same time. They willl each have their own account name/password.

      Is it possible to create a script where User A only generates odd numbered invoices and User B only generates even numbered invoices?

        • 1. Re: Auto-Serial - Can it be account name dependent?
          Sorbsbuster

          A question with a question: why would you want that to happen?

          • 2. Re: Auto-Serial - Can it be account name dependent?
            mauigirl

            Sometimes one of the users will be offline.  So I need a way for him to create invoices but then merge them back into the main file without creating duplicate invoice numbers.

            • 3. Re: Auto-Serial - Can it be account name dependent?
              Sorbsbuster

              That is a classic problem of using two files independently.  Issuing odd- and even-numbered serial numbers is an unusual idea.  It is in effect the same as allocating a batch of numbers to each user.  You could do that by having a table which logs the last Invoice Number raised by that particular user and increments it when they raise another invoice (and uses that incremented number for the invoice).  You can set User 1's range to start at 1000, User 2's at 2000, and set a cap on each so that they have to be allocated a new range when they hit the ceiling.

              I think, however I would prefer to give each user an 'Offline mode' file.  After all, they must be prepared to work off-line, as they need to have a copy of the file with them in case they will not be on-line to the hosted file.

              I would give them a file which is used off-line just to capture the details of the invoice (which may be a very simple single-layout screen, or a functional copy of the main file) and then when they are able to go on-line again they can upload the invoices they have created, and at the point of import they are allocated the next serial number only in the main database.

              Both methods work for any number of potentially off-line users.