On 6/25/2013 1:03 PM, Kramer, Jason J wrote:
Can you use AUTONUM?
                                Jason

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Les Stark
Sent: Tuesday, June 25, 2013 1:54 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Fwd: Assigning Invoice Numbers




-------- Original Message --------
Subject:        Assigning Invoice Numbers
Date:   Tue, 25 Jun 2013 12:32:59 -0500
From:   Les Stark <[email protected]>
To:     [email protected]



I am having a problem with duplicate invoice numbers.
    I have a table INVNUM with a column INVNBR that holds an integer value for 
the invoice number.
    When I create a new invoice,    SET VAR VINV#=INVNBR IN INVNUM    to
get the last invoice number from the table
       then I increment that number   SET VAR VINV#=(.VINVNBR +
1)           the incremented number is used for the current invoice
       then I update the table               UPDATE INVNUM SET INVNBR=.VINV#

     The table is ready for the next new invoice and the current invoice is 
written with the value of VINV# This is a multiple user database and is using 
Row Locks, Column Verify on the tables How am I getting duplicate invoice 
numbers?
Is there a better way to assign Invoice Numbers?


I am not sure how you would use AUTONUM.... you would have to create multiple records and get the maximum number or some sort of code. I have multiple people creating invoices now, but not sure how the problem is happening. If one user attempts to get an invoice number while another is updating that record, will it lock out the access?

--

Reply via email to