Dbcolumn update problem

I’m using dbcolumn to get @max +1 from invoices numbers from the invoice view. Homever, sometime, if I create an invoice for a first time since my application is open, all is ok; new invoice number is equal to @max(invoicenumbers list)+1. Homever, if I try to create a second invoice without close application, the @max +1 is equal to the last invoice number created. I use nocache in dbcolumn request. What’s wrong ??

Subject: I’d use a Profile Document

I’d recommend using a Profile document to keep track of the next invoice number. When an invoice is saved the first time, assign it the value from the Profile. Then add 1 to the value in the Profile and re-save the Profile.

Subject: Do NOT use a Profile Document for this…

… unless you’re the only user of the system. Since profile documents are cached in memory, Notes client users may see a different value from each other and web users may see a different value from Notes users.

There are literally thousands of documents here and in the Notes 4 & 5 forum about techniques for sequentially numbering documents; have a look to see which approach is best for your application.