LastModified not updated when document added to a folder?

Can someone clarify when the NotesDocument.LastModified and NotesDatabase.LastModified timestamp properties are updated.

I am trying to optimize processing by using the LastModified timestamps to detect when changes have occurred to documents (and using OpenIfModified to skip datebases where no changes have happened). One of the changes I am interested in, is adding or removing documents from folders.

It seems that neither the database or document timestamps are updated when documents are added or removed from folders. This is the case even when FolderReferencesEnabled = True, when moving documents between folders causes changes to the document items that contain the folder references.

Subject: LastModified not updated when document added to a folder?

Dear Dave,

Moving documents to folder is not going to change their lastmodified property. Because you are not making changes to any of the documents fields. A folder is just a means to display the documents, they dont store them. The documents are stored in your database.

And FolderreferencesEnabled only tells you the folders that “display” your documents.

If you want to update the lastmodified property of the documents, create a simple agent which moves your documents to desired folder and at same time, update the document,(may be just save it).

Regards

Rosie

Subject: RE: LastModified not updated when document added to a folder?

Rosie

Adding documents to folders does cause the document properties to be modified if folder references are enabled. These properties include:

$FolderRef

$FolderRefID

$FolderRefFlags

I would expect changes to these properties to cause the documents LastModified date to be updated. Even whenfolder references are not enabled, I would expect the databases LastModified date to change since there is an internal change in the database.

Subject: RE: LastModified not updated when document added to a folder?

Those items are probably flagged as no-update on purpose, since there is no substantive change to the document. One wouldn’t (normally) want a “new or modified” agent operating against a document just because it’s been placed in a folder.