In Lotus Domino Designer®, when using the LotusScript CopyToDatabase method (of the NotesDocument class), a new UNID is not generated for a document each time it is copied to a target database. If a copied document is deleted from the target database and then copied from the source a second time, the resulting document's UNID will match the UNID of the first document copied (within the target database).
Example:
1. A document in a source database has the following UNID (spaces added to ease reading):
86A84028 1DE69507 85256A9D 005635D0
2. The copy generated by CopyToDatabase has the following UNID (the last 16 characters match the original document's UNID):
E7271252 50D66FE4 85256A9D 005635D0
3. If the above copy is deleted and copied again, the UNID is a duplicate of #2 above):
E7271252 50D66FE4 85256A9D 005635D0
This can present an issue for some applications in which an agent copies documents, documents are being deleted, and replication is occurring, with the result being save/replication conflicts instead of actual documents.
NOTE: If the documents are manually copied from the source and pasted into the target database, then new UNIDs are always generated. If a document is copied twice using the CopyToDatabase method without deleting the first one, the second copy will always have a new and unique UNID.
This issue was reported to Quality Engineering as SPR# ASHW4X9P8R and was fixed in Lotus Notes®/Domino 6.0.4, 6.5.2, 7.0, and later releases, by the addition of an optional notes.ini parameter. The following notes.ini parameter forces a new UNID to be created for a document after being copied to the destination database:
1. Create two databases: DB1 and DB2.
2. In both databases, create a view called UNID and place Steps a-d below into both views.
4. Create one or more new documents using this form.
5. In the UNID view of DB1, click the button to copy these new documents to DB2.
6. Open DB2 and look at the UNIDs for the documents. Copy the number down or make a screen shot of them.
7. Delete the documents from DB2.
8. Go back to DB1 and click the button again to copy the documents to DB2.
9. Open DB2 again and note the UNIDs of the documents. They are the identical set of UNIDs of the docs you deleted.
10. Delete the document(s) from DB2 and use the button to copy the document(s) again. Every time you copy over the document(s), the UNIDs in DB2 will always be the same UNIDs. If you copy the documents a second time without deleting them, a new set of UNIDs is created.