eagles1 Posted October 2, 2006 Posted October 2, 2006 In our invoicing system, I stored a running invoice number in a field in a table. When user has completed entering the invoice, my script will go to this table and get this running number, and then increment this number by 1 before exit. In multiuser, we often encounter two invoices having the same invoice number. It looks to me two users happened to go to the same field and retrieve the same running number. I tried using Open Record to 'lock' the field but it does not work. This is giving us a big headache. Appreciate any help how to overcome this.
Ender Posted October 2, 2006 Posted October 2, 2006 In general, I don't like this serial numbering technique because of the record locking issues, but I assume you have a good reason. If you post the script you're using to retrieve and increment the serial, maybe there's a way to work around it by doing more error trapping.
eagles1 Posted October 3, 2006 Author Posted October 3, 2006 The code is very simple. I simple go to the layout, find that record and read the serial number field. I then increment that field before returning to the main program. I agreed with you this method is not ideal but I cannot think of other way. I am more than happy to change my coding, Appreciate you can share with me a better of way of handling this situation. Thank you
comment Posted October 3, 2006 Posted October 3, 2006 What is "this situation"? What prevents you from having an auto-entered serial number in the Invoices table itself?
eagles1 Posted October 3, 2006 Author Posted October 3, 2006 Let me explain our situation. Our invoicing table is actually a general purpose 'billing' table. It is being used for Quotation, PreOrder and Invoicing. We have a field called TypeOfTransaction to differentiate between them. Each has its own running number. If user is doing quotation, then the so called "invoice number" field will store the Quotation running number and so on. As such we cannot make use of the auto-entered serial number. We stored all the running number in a separate table as I have described earlier. But we run into duplicate number especially for Invoicing.
Recommended Posts
This topic is 6628 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now