• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 329
  • Last Modified:

duplicate document record numbers

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...
0
kat64
Asked:
kat64
2 Solutions
 
Bill-HansonCommented:
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.
0
 
SysExpertCommented:
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 !
0
 
marilyngCommented:
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.

0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
kat64Author Commented:
...I am sunsetting this question for now...Thanks for your help!!!
0
 
kat64Author Commented:
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");
@Set("DocYear";@DbLookup("":"NoCache";"":"";"(Tracking)";"TrackingNumber";"Year"));

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

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));
      @SetField("Status";"Open");continue);continue);.....

Ex of assigned number: ES-2007-01158. There is also a trackingNumber profile document.
0
 
SysExpertCommented:
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 !



0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now