Solved

@Unique

Posted on 2004-10-08
13
448 Views
Last Modified: 2013-12-18
I have a field which is Computed and set to @Unique.  However I seem to have ended up with two documents with the same 'unique' reference.  Does anyone know how this can happen?
0
Comment
Question by:fayeb
  • 5
  • 3
  • 2
  • +3
13 Comments
 
LVL 14

Expert Comment

by:p_partha
Comment Utility
YOu mean @unique without parameters, It returns a random text value, although very rare, there might be a case where it repeats..

IN querysave you can do one more check (which may also fail) to see whether there are any other document with the same value or run a scheduled agent to check for duplicates and create new unique values

Partha
0
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
This can rarely happen...In my experience I have never come across this problem !

Always make the field computed when composed.. so that it is not recomputed often.. which can raise a duplicates if there are other process triggered by same user which involves @unique

~Hemanth
0
 
LVL 13

Expert Comment

by:CRAK
Comment Utility
You've used a few words that set off a trigger here: "two documents" and "reference".
To avoid miscommunication: do you have two doc's, each with a double value, or two doc's sharing the same value?
@Unique won't be of any help to avoid the latter.

In the first scenario: I assume @Unique is applied in a translation formula. Does the field hold multiple values? And if so, if you look at the field in the documents properties: are they stored as text or as test lists?
If text lists: are the duplicate values (in the same field on the same document) true duplicates, or does one of the values perhaps have e.g. an additional space appended?

Any lotusscripts or agent adressing (writing) the field, bypassing the @unique fomula?
0
 
LVL 19

Accepted Solution

by:
RanjeetRain earned 250 total points
Comment Utility
There is a one-in-a-million chance of the value being duplicated.

Have you ever thought of using @Text(@UniqueDocumentID) instead?
0
 
LVL 19

Expert Comment

by:RanjeetRain
Comment Utility
Another line of thought would be to combine Hemantha and CRAK's suggestions.

Make your field a single value field and set the field type to CwC.
0
 
LVL 19

Expert Comment

by:madheeswar
Comment Utility
@Text(@UniqueDocumentID) has some problem.

When copy and paste a document, it has the same UNID stored in the field stored.  But in reality, the Doc id has been changed. So, u need to refresh the field in the doc manually or through code to get the new UNID of the doc.

If u make CWC and use @Text(@UniqueDocumentID), then u go into bigger problem. Even when refreshed, it won't change the value stored in the CWC field.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 13

Expert Comment

by:CRAK
Comment Utility
Interesting, but strange. I've never seen that happen before. Only in cases where the doc id was stored in an additional field in effort to maintain "relational integrity".
In that case @Text(@UniqueDocumentID) isn't the problem, but (like you claim) the value stored in that field.
0
 
LVL 19

Expert Comment

by:madheeswar
Comment Utility
CRAK,
you are correct. when it comes to relational integrity between documents (consider a Unique Key), this problem arrises.

0
 
LVL 19

Expert Comment

by:RanjeetRain
Comment Utility
>> When copy and paste a document, it has the same UNID stored in the field stored. But in reality, the Doc id has been changed. So, u need to refresh the field in the doc manually or through code to get the new UNID of the doc

Releational Integrity was not a part of the original question and hence not important (IMO) wrt this question. If a person worries about relation integrity, he/she can always write a handler for the PostOpen event of the View. Trivial work.
0
 
LVL 19

Expert Comment

by:RanjeetRain
Comment Utility
Typo:

Such code handler should be written for POSTPASTE event.
0
 

Author Comment

by:fayeb
Comment Utility
I used @DocumentUniqueID to get around the problem.  I still do not understand why I have ended up with duplicate references using @unique.  The field was a single value computed field.  I don't need to worry about pasted documents as the application is web based only and copy and pasting is not allowed in the database.

'relational integrity' was the reason I needed the field to be unique as all the data gets exported into an access database.
0
 
LVL 13

Expert Comment

by:CRAK
Comment Utility
In situations where @DocumentUniqueID is NOT used, I guess copy/paste of documents, creation of documents at different locations (local + server, different servers etc.), simultaneous creation of documents and edit/save replication/save conflicts are the most common causes. Plenty of options!

Using @DocumentUniqueID (current situation) copy/paste and replication/save conflicts remain as probable cause for error. Not to mention any additional code to alter the field of course.

Using a computed field (instead of cwc), editing/saving a save conflict would recompute the field, providing a new unique value (cwc whould keep the original doc id).

The remaining copy/paste cause is ruled out bu Ranjeets suggestion to capture pastes.

Whatever caused it; you're much safer now!
0
 
LVL 19

Expert Comment

by:RanjeetRain
Comment Utility
Glad you resolved it!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

763 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

7 Experts available now in Live!

Get 1:1 Help Now