AnsweredAssumed Answered

Record Locking Problem

Question asked by RonCates on Mar 24, 2011
Latest reply on Mar 28, 2011 by RonCates


Record Locking Problem


I've been developing a solution for our company for a couple years now. Some time last year I came up with an invoice numbering system for our office use ( Not for use as any kind of key). At the time only a select few were actively using the database. Now we have begun expanding it's use to other people in the office and this has caused a record locking problem when incrimenting the invoice number. I have read many things reguarding how to deal with something like this but at the moment I can't think of any of the techniques. The script is called from within the invoice creation script and looks like this:

Perform Script[ “User Abort” ]
Set Field [ Tickets::ticket_num; Right("000" & (Jobs::ticket_num + 1); 4) ]
Set Field [ Jobs::ticket_num; Jobs::ticket_num + 1 ]

I was hoping there might be a quick fix. Right now a dialogue pops saying John Doe is modifying the record but after it continues on to create the invoice without changing the number for the next invoice and we end up with duplicate invoice numbers. Any help would be appreciated.