Link to home
Start Free TrialLog in
Avatar of Kat A
Kat A

asked on

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...
Avatar of Bill-Hanson
Bill-Hanson
Flag of United States of America image

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.
Avatar of SysExpert
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 !
ASKER CERTIFIED SOLUTION
Avatar of marilyng
marilyng

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Kat A
Kat A

ASKER

...I am sunsetting this question for now...Thanks for your help!!!
Avatar of Kat A

ASKER

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.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Forced accept.

Computer101
EE Admin