duplicate document record numbers

Posted on 2007-10-03
Last Modified: 2013-12-18
Whenever there are alot of users in this document management database, the document record ids duplicate.  The database isn't replicating to any other database.  I do see an agent resets the annual id counter.  Other than that...I don't know why this is happening.  Please help!!  Thanks...
Question by:kat64
    LVL 22

    Expert Comment

    Notes is not a relational database system, so it does not maintain sequential numbering systems well.  It sounds like your database has a custom numbering engine built into it.  You will need to explain the system in detail or post the source code for us to have a chance of helping you.
    LVL 63

    Expert Comment

    I agree. It depends on how how the ID numbering was implemented.

    If the Docs themselves are not duplicates, you may simply need a agent to renumber them.

    I hope this helps !
    LVL 18

    Accepted Solution

    Probably what is happening is one of two things:  the document counter is being set in a profile document, which doesn't refresh - since profile documents are really meant for somewhat static information, or the counter is collecting the next sequence number from a view when the document opens (post open event on the form), which means a bunch of people can open a document and get the same number - this approach is usually tied to a view of saved documents.  The view of saved documents doesn't refresh until someone saves the document, so again, a bunch of people can open a document and get the same number.

    Probably this is because someone wanted to see the next sequence number while they're working on the form.  In reality, the only way this type of sequential numbering works is when the document is being saved and is closing.  This is probably the only way to insure that you're not going to get a duplicate number - and even that isn't foolproof if you have two people saving a document at the same time.

    But as Bill-Hanson properly comments, Notes is not a relational database system with record locking.


    Author Comment

    ...I am sunsetting this question for now...Thanks for your help!!!

    Author Comment

    Hi guys...back to the duplicate tracking numbers...Investigating the problem resulted in seeing that the duplication is coming from a tracking number...not the document id.  The document id is unique each time.  Here's the code behind the tracking number assignment...

    Rem {need to assign a number?};
    AssignNumber := @If (TaskNumber = ""; "Yes"; "No");
    DocYear := DocYear;
    ControlNum := ControlNum;
    Rem {Get docID of control form};
    ControlID := @DbLookup("":"NoCache";"":"";"(Tracking)";"TrackingNumber";"DocumentID");

    Rem {Get control number};
    @If( @Text( @Year( @Today)) != DocYear;
          @Do (  @Set("ControlNum"; 1);
                 @SetDocField(ControlID; "Year"; @Text( @Year( @Today))));
                @Set("ControlNum";@TextToNumber( @DbLookup

    NewNum := "ES-" + @Text(@Year(@Today)) + "-" + @Right("0000" + @Text(ControlNum);5);
    NewControl := ControlNum + 1;

    @If(AssignNumber = "Yes";
          @Do( @Setfield ("TaskNumber"; NewNum);
          @SetDocField(ControlID; "TrackNum"; @Text(NewControl));

    Ex of assigned number: ES-2007-01158. There is also a trackingNumber profile document.
    LVL 63

    Assisted Solution

    Don't use a control number, put in a date in the format of  yyyymmdd, and then use unique to create an additional ID to be added.

    Tracking numbers should not need to be sequential.
    I hope this helps !

    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
    Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now