Solved

@Unique

Posted on 2004-10-08
13
460 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
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.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

622 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