Search This Blog

Thursday, May 29, 2014

How to create a NotesDocument with creation date in the PAST or in the FUTURE

Hi guys

You may know that UniversalID (as ReplicaID) is relative to the Date-Time when it was generated.
Here I have described my finding regarding it.

However later I discovered even more interesting thing.
As you may know UniversalID property of NotesDocument class is Read/Write and you may assign required UniversalID to existing/new NotesDocument. The most important thing about it is that together with UniversalID you also set an initial creation date-time that was at the moment when your UniversalID was generated.

This is very interesting thing and, honestly speaking, I am not so sure that this is good.
I can't get all consequences of such behavior, especially regarding replication but just imagine - you can create a document with the creation date that is earlier than you have started to work in your company, break something and then say: "sorry, I have no idea what happened but as you see the document was created when I wasn't born yet" :-)

Check screens below

1) I opened standard pernames.ntf from Data folder of my Lotus Notes client and took UniversalID of the first form

 that is created at 18.07.1998 05:13:11


2) Write simple code

Sub Initialize
Dim s As New NotesSession
Dim doc As NotesDocument
Set doc = s.currentdatabase.createdocument
doc.UniversalID = "0135C1C3C6FC636185256645000C319F"
Call doc.save(True, False)
End Sub

3) Check the result


The same way let you 'create' NotesDocument or design element (any note) either in the past or in the future.

No comments:

Post a Comment