doc.LastModified doesnt't work as advertised

Oh well…

doc.LastModified should give us… the date and time a document was last modified.

But it returns the date and time it was last modified in this specific replica instead.

Unlike @Modified, which is not replica specific…

Is there a way in “pure LS” to know the real last time a document was modified ?

Before you ask, yes, Evaluate (“@Modified”, doc) does the trick, but I’m looking for a saner way to do it.

Using Evaluate to get a document’s last modification date does not fit my “clean code” criteria.

Subject: doc.LastModified doesnt’t work as advertised

Bonjour,

Here is how it works ::

Instead of just using doc.LastModified write your code as ::

'First Get the universalID of the document

unid$ = doc.UniversalId

'Search the document in database by universal ID

set RecDoc= db.getdocumentbyunid(unid$)

'RecDoc represents a unique document in all replicas

LastDate$ = Recdoc.LastModified

Then you will get the actual recent modified date irrespective of the replicas.

I hope this gave an idea how it works.

LOL

~Vinay

Subject: RE: doc.LastModified doesnt’t work as advertised

Thanks again for your answer and your sense of humor. :slight_smile:

Now I understand what you meant.

Alas, UNIDs do not work the way you described.

The document returned by db.GetDocumentByUNID(doc.UniversalID) is exactly the same document as the original one, and the LastModified property sports the exact same value.

Subject: doc.LastModified doesnt’t work as advertised

BonJour Nocola…

Here we need to differentiate between NoteID and Universal ID of the document.

Universal ID :: A unique numberf which identifies a document in all of its replicas.

NoteID :: A unique number which identifies the document within the database.

So U can use ::

unid$ = doc.UniversalID

Set notesDocument = notesDatabase.GetDocumentByUNID( unid$ )

If we do not get to drink water atleast we may need to take a dive in the sea. :slight_smile:

Hope this will solve your problem.

Regards

`Vinay

Subject: RE: doc.LastModified doesnt’t work as advertised

Hi Vinay, thanks for your answer.I don’t see how it relates to my question though.

Have a nice bath.

Subject: RE: doc.LastModified doesnt’t work as advertised

LOL

And I am trying to figure out the whole sea water thing. :slight_smile: