Hi,We have a Notes application that is suppose to create unique document numbering when a form is saved. Somehow few of the documents have been given a same number. I’d like to find all such documents with identical document numbers. Could you assist in providing the code to be placed in a view to select only such ducuments.
Thank you in advance
Pirooz
Subject: Duplicate values
There may be an easier way to do this, but we set this up a number of years ago and haven’t had a problem, so haven’t tried to rewrite.
It’s a two-step process - you create a button that runs an agent and then opens a view.
The button code is:
@Command([ToolsRunMacro];“DupSearch”);
@Command([OpenView] ; “Dupes”)
The agent is formula, runs on Action Menu Selection on All Docs in Database, with the document selection filled out indicating which form to search for. The actual code of the agent is:
hits := @DbLookup( null : “NoCache” ; “” : “” ; “All” ; titleCode ; 1 );
numHits := @Elements(hits);
FIELD isDup := @If(numHits >1 ; 1; 0);
SELECT @All
where “All” is a view with the first sorted column containing the field titleCode. The agent runs through the view, takes each document in order, then does a lookup for other docs with that title code. If it finds more than one, it sets a field called isDup.
The button code then opens the view Dupes, which has a selection formula of SELECT form = “kComp” & isDup = 1 where kComp is the form that I was searching on with the agent. The view is categorized by titleCode so that all duplicates of a specific title code are grouped together.
We then go through and manually delete the undesired documents, then run a button that resets isDup to 0 on remaining documents.
Subject: RE: Duplicate values
Thank you so much. I will give this a try.
pirooz