Solved

@Unique

Posted on 2004-10-08
13
452 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
ID: 12260435
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
ID: 12260460
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
ID: 12261721
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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 19

Accepted Solution

by:
RanjeetRain earned 250 total points
ID: 12268209
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
ID: 12268217
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
ID: 12274259
@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
 
LVL 13

Expert Comment

by:CRAK
ID: 12274653
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
ID: 12274687
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
ID: 12285143
>> 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
ID: 12287316
Typo:

Such code handler should be written for POSTPASTE event.
0
 

Author Comment

by:fayeb
ID: 12287419
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
ID: 12289315
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
ID: 12299830
Glad you resolved it!
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Send a link through lotus notes automated mail 11 141
Add a cc field to email code 6 99
Add code to Lotus Notes view column 2 123
Why the url within notes is no action 6 48
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…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

786 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