Hi,
I have created an Invoice system. All is good until more users create an invoice in the same time.
I have an BO which holds the series of the invoices. Inside this BO I have BOSerie.CurrentNumber which is the current number of the serie and is increased each time e new invoice is created by a process.
The process does like this:
ENTER NEW Invoice
Increase BOSeries.CurrentNumber By 1
If 2 users fires up this process in the same time they ends up with the same number for that invoice.
I cannot increase the current number before ENTER NEW, because it happens that users change their mind and cancel the creating process. If that happens in the system I will have empty invoices..Not good.
I know if I scratch my brains harder I will find the solution , but it's more easier to cry for help hoping someone invented the wheel already 🙂
Thank you.