Profile documents in Notes

Lotus Domino
I use profile documents in Notes to put a unique document number on forms. I put the number on during postopen using lotus script. After I access the profile, and update it, I save and close the profile document. (Close PurchaseProfile). I am still getting duplicate numbers. Is there anything else that can be done to prevent this?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Which version are you using?

Discuss This Question: 3  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Kmpgmr
    Don't use a profile document. Use a view sorted by your unique document number and then use the following function on your querysave event. I called my field SeqNo. You'd of course revise this to be whatever field you determine. If Source.IsNewDoc Then Call Source.FieldSetText("SeqNo", Cstr(SeqNo)) End If Function SeqNo As Double Dim db As NotesDatabase Dim vw As NotesView Dim sess As New NotesSession Dim doclast As NotesDocument Dim LastNo As Double Set db = sess.CurrentDatabase Set vw = db.GetView("vwSeqNo") Set doclast = vw.GetLastDocument If doclast Is Nothing Then SeqNo = 1 Else LastNo = Cdbl(doclast.SeqNo(0)) 'LastNo = Cdbl(Val(doclast.SeqNo(0))) SeqNo = LastNo + 1 End If End Function
    290 pointsBadges:
  • Ramdisk
    I had the same problem some time ago using the proposed way: taking a view, seeking for the last doc and increment the counter. Although I used always the view.refresh method, double numbers were created from time to time, because you cannot control WHEN Notes actually refreshes the view! It depends on the server load and amount of documents in the database - in both terms it was heavy in my case! So I use now a "counter document", where the last number is stored. During Querysave of the new doc, this counter doc is accessed, the number will be increased and stored again. This works without problems since 2 years, double numbers didn't show up anymore.
    0 pointsBadges:
  • Brooklynegg
    I agree with ramdisk. In R5 with his method (counter document) I somehow still ended up with some duplicates, but with R6 and upgraded servers, I no longer have this problem. If the app is multi-server, or replicated, you will want to hard code to one instance of the database, capture errors if users can't access that instance, and have a backend process to number records that don't get a new number from user action (replicate in later after a failed attempt).
    3,845 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: